:root {
  --bg: #f4f6f5; --card: #ffffff; --text: #17201d; --muted: #66736e; --line: #e2e8e5;
  --accent: #0f766e; --accent-ink: #ffffff; --pos: #0f7b3e; --neg: #b42318; --warn-bg: #fff7e0; --warn: #8a5a00;
  --ok-bg: #e7f6ef; --err-bg: #fdecea; --jc: #0f766e; --ta: #c2410c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1412; --card: #161e1b; --text: #e6ece9; --muted: #93a19b; --line: #26312d;
    --accent: #2bb3a3; --accent-ink: #062320; --pos: #4ade80; --neg: #f87171; --warn-bg: #2d2410; --warn: #f5c76b;
    --ok-bg: #12291f; --err-bg: #2f1514; --jc: #2bb3a3; --ta: #fb923c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
h1, h2 { margin: 0 0 .6rem; } h2 { font-size: 1.05rem; }
.top { display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.brand { font-weight: 700; color: var(--text); }
.who { color: var(--muted); font-size: .9rem; }
main { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.card.center { text-align: center; margin-top: 12vh; display: grid; gap: 12px; }
.hero .big { font-size: 1.25rem; margin: .3rem 0; }
.amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .late { color: var(--neg); font-weight: 600; }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.row { display: flex; align-items: center; flex-wrap: wrap; } .gap { gap: 10px; } .between { justify-content: space-between; gap: 8px; } .grow { flex: 1 1 140px; }
.stack { display: grid; gap: 12px; margin: 0; }
label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); }
input, select { font: inherit; font-size: 16px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; } legend { font-size: .9rem; color: var(--muted); margin-bottom: 4px; padding: 0; }
.btn { display: inline-block; font: inherit; border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 10px 14px; border-radius: 10px; cursor: pointer; text-align: center; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--neg); } .btn.small { padding: 6px 10px; font-size: .85rem; } .btn.block { width: 100%; }
details > summary { cursor: pointer; list-style: none; margin: 8px 0; } details > summary::-webkit-details-marker { display: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 10px 14px; color: var(--text); cursor: pointer; display: block; }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); } .list li:first-child { border-top: 0; }
.list li.off { opacity: .55; } .mov li.deposito a { font-weight: 600; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.applied { color: var(--pos); } .tag.needs_review { color: var(--warn); background: var(--warn-bg); } .tag.pending { color: var(--accent); }
.msg { padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: .92rem; }
.msg.ok { background: var(--ok-bg); } .msg.err { background: var(--err-bg); color: var(--neg); } .msg.warn { background: var(--warn-bg); color: var(--warn); }
table.bal { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.bal th, table.bal td { text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.bal th:first-child, table.bal td:first-child { text-align: left; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.bar-row { margin: 10px 0; } .bar { height: 8px; background: var(--bg); border-radius: 4px; margin-top: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 4px; } .bar .jc, .sw.jc { background: var(--jc); } .bar .ta, .sw.ta { background: var(--ta); }
.legend { font-size: .85rem; color: var(--muted); } .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 10px; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; align-items: center; background: var(--card);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabs a { color: var(--muted); font-size: .8rem; padding: 8px 6px; }
.tabs a.add { background: var(--accent); color: var(--accent-ink); font-size: 1.5rem; line-height: 1; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
progress.bar { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--bg); display: block; margin-top: 3px; }
progress.bar::-webkit-progress-bar { background: var(--bg); border-radius: 4px; }
progress.jc::-webkit-progress-value { background: var(--jc); border-radius: 4px; } progress.jc::-moz-progress-bar { background: var(--jc); }
progress.ta::-webkit-progress-value { background: var(--ta); border-radius: 4px; } progress.ta::-moz-progress-bar { background: var(--ta); }
.qr { display: block; margin: 0 auto; width: 220px; height: 220px; background: #fff; border-radius: 8px; }
.secret { word-break: break-all; text-align: center; font-family: ui-monospace, monospace; }
pre.codes { font-family: ui-monospace, monospace; background: var(--bg); padding: 12px; border-radius: 10px; text-align: center; }

.back { display: inline-block; margin: 0 0 10px; font-size: .9rem; }
.tabs a.on { color: var(--accent); font-weight: 600; }
/* Computadora: la barra va arriba, junto al nombre, en vez de abajo. */
@media (min-width: 900px) {
  body { padding-bottom: 24px; padding-top: 64px; }
  .top { position: fixed; top: 0; left: 0; right: 0; z-index: 2; height: 56px; padding: 0 24px; pointer-events: none; }
  .top > * { pointer-events: auto; }
  .tabs { top: 0; bottom: auto; height: 56px; justify-content: center; gap: 28px; border-top: 0; border-bottom: 1px solid var(--line); padding: 0; z-index: 1; }
  .tabs a { font-size: .95rem; }
  .tabs a.add { width: 36px; height: 36px; font-size: 1.2rem; }
}
