/* muyu app — claro, sutil, con aire */
:root {
  --bg: #f4f5ef;
  --card: #ffffff;
  --line: #e6e8df;
  --text: #1c2118;
  --muted: #7a8272;
  --muted-2: #a3a99b;
  --olive: #6f8a2f;
  --olive-ink: #4f6522;
  --olive-soft: #eef2e2;
  --moss: #3a5a40;
  --amber: #b8892e;
  --amber-soft: #fbf3df;
  --red: #c3503f;
  --red-soft: #fbe9e6;
  --grey-soft: #eeefe9;
  --r: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
button { font-family: inherit; }
input { font-family: inherit; font-size: 16px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; width: 100%; outline: none; }
input:focus { border-color: var(--olive); box-shadow: 0 0 0 4px rgba(111,138,47,.12); }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
label input { margin-top: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }

/* ---- Marco ---- */
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: calc(16px + var(--safe-t)) 20px calc(96px + var(--safe-b)); }
.top { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 22px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; letter-spacing: -.03em; color: var(--olive-ink); }
.brand .logo { width: 32px; height: 32px; object-fit: contain; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--olive-soft); color: var(--olive-ink); display: grid; place-items: center; font-weight: 800; border: none; cursor: pointer; font-size: 15px; }
.hello { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.title { font-size: 26px; font-weight: 800; margin-bottom: 18px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 14px; }
.card.olive { background: linear-gradient(160deg, #6f8a2f, #4f6522); color: #fff; border: none; }
.card.olive .muted { color: rgba(255,255,255,.7); }
.card.soft { background: var(--olive-soft); border-color: transparent; }
.card.amber { background: var(--amber-soft); border-color: transparent; }
.card.red { background: var(--red-soft); border-color: transparent; }
.card.grey { background: var(--grey-soft); border-color: transparent; }

/* ---- Estado ---- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 6px 12px 6px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 30px; margin-bottom: 18px; }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--olive); box-shadow: 0 0 0 3px rgba(111,138,47,.15); }
.status.off i { background: var(--muted-2); box-shadow: none; }
.status.warn i { background: var(--amber); box-shadow: 0 0 0 3px rgba(184,137,46,.15); }
.status.bad i { background: var(--red); box-shadow: 0 0 0 3px rgba(195,80,63,.15); }

/* ---- Números grandes ---- */
.big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.big small { font-size: 15px; font-weight: 600; letter-spacing: 0; margin-left: 4px; opacity: .8; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two > div { padding: 2px 0; }
.lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.card.olive .lbl { color: rgba(255,255,255,.75); }
.bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.22); overflow: hidden; margin-top: 16px; }
.bar i { display: block; height: 100%; background: #fff; border-radius: 6px; transition: width .5s; }
.card:not(.olive) .bar { background: var(--olive-soft); } .card:not(.olive) .bar i { background: var(--olive); }
.cover { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; font-size: 13px; }

/* ---- Pago ---- */
.pay-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pay-amount { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pay-when { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.pay-note { font-size: 13px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.06); color: var(--muted); }
.pay-note.warn { color: var(--amber); } .pay-note.bad { color: var(--red); font-weight: 600; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: var(--olive-soft); color: var(--olive-ink); white-space: nowrap; }
.pill.amber { background: #f3e5c2; color: #8a6420; } .pill.red { background: #f5d3ce; color: #9a3a2c; } .pill.grey { background: var(--grey-soft); color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: none; border-radius: 16px; padding: 15px; font-size: 15px; font-weight: 700; cursor: pointer; background: var(--olive); color: #fff; transition: transform .1s, opacity .15s; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; }
.btn.light { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.sm { width: auto; padding: 9px 14px; font-size: 13px; border-radius: 12px; }
.btn svg { width: 17px; height: 17px; }

/* ---- Lista ---- */
.list { display: grid; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; padding-bottom: 0; } .row:first-child { padding-top: 0; }
.row .t { font-weight: 700; font-size: 14px; } .row .s { font-size: 12.5px; color: var(--muted); }
.row .amt { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* ---- Gráfico ---- */
.seg { display: flex; background: var(--grey-soft); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button { flex: 1; border: none; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; padding: 9px; border-radius: 10px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.chart { position: relative; height: 210px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare > div { background: var(--grey-soft); border-radius: 14px; padding: 12px 14px; }
.compare .v { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; } .compare .d { font-size: 12px; color: var(--muted); }

/* ---- Nav inferior ---- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 0 20px calc(14px + var(--safe-b)); pointer-events: none; }
.nav-inner { pointer-events: auto; display: flex; width: 100%; max-width: 440px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 22px; padding: 6px; box-shadow: 0 8px 30px rgba(28,33,24,.10); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px; border-radius: 16px; color: var(--muted); font-size: 11.5px; font-weight: 700; text-decoration: none; }
.nav a svg { width: 21px; height: 21px; }
.nav a.on { background: var(--olive-soft); color: var(--olive-ink); }

/* ---- Login ---- */
.login { min-height: calc(100vh - 40px); display: flex; flex-direction: column; justify-content: center; }
.login .brand { font-size: 34px; justify-content: center; margin-bottom: 6px; } .login .brand .logo { width: 56px; height: 56px; }
.login .sub { text-align: center; color: var(--muted); margin-bottom: 34px; }
.login form { display: grid; gap: 14px; }
.err { color: var(--red); font-size: 13px; text-align: center; }
.foot { text-align: center; color: var(--muted-2); font-size: 12px; margin-top: 26px; }

/* ---- Hoja inferior (modal) ---- */
.sheet-bg { position: fixed; inset: 0; background: rgba(28,33,24,.45); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet { width: 100%; max-width: 520px; background: var(--bg); border-radius: 26px 26px 0 0; padding: 12px 20px calc(24px + var(--safe-b)); max-height: 92vh; overflow: auto; animation: up .25s ease; }
.sheet .grip { width: 40px; height: 5px; border-radius: 5px; background: var(--line); margin: 0 auto 16px; }
.sheet h2 { font-size: 20px; margin-bottom: 4px; }
.sheet .body { display: grid; gap: 14px; margin-top: 18px; }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bank { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 13.5px; display: grid; gap: 4px; }
.bank b { font-size: 14.5px; }
.cc { background: linear-gradient(140deg, #2b3a1f, #4f6522); color: #e9efd8; border-radius: 18px; padding: 18px; }
.cc .n { font-size: 18px; letter-spacing: .12em; font-variant-numeric: tabular-nums; margin: 16px 0 12px; font-weight: 700; }
.cc .r { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.cc .r b { display: block; font-size: 13px; letter-spacing: 0; text-transform: none; opacity: 1; color: #fff; }
.processing { display: grid; place-items: center; gap: 14px; padding: 34px 0; text-align: center; }
.spin { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--olive); animation: spin .8s linear infinite; }
.ok { width: 70px; height: 70px; border-radius: 50%; background: var(--olive-soft); color: var(--olive); display: grid; place-items: center; } .ok svg { width: 36px; height: 36px; }
.menu { display: grid; gap: 6px; }
.menu .item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.menu .item:last-child { border-bottom: none; }
.install { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--olive-soft); border-radius: 16px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; color: var(--olive-ink); }

.toasts { position: fixed; left: 0; right: 0; top: calc(14px + var(--safe-t)); display: grid; justify-items: center; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 30px; font-size: 13.5px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: down .25s ease; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes up { from { transform: translateY(30px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes down { from { transform: translateY(-10px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
