/* Netapp — light, card-based, green accent. Mobile-first PWA. */

:root {
  color-scheme: light;
  --bg: #f1f0ec;
  --card: #ffffff;
  --card-soft: #f8f7f4;
  --ink: #1c1c1e;
  --ink-2: #4a4a4c;
  --muted: #6e6e68;
  --hairline: #ecebe6;

  --green: #35c877;
  --green-ink: #2a9d5f;
  --green-tint: #e5f5ec;
  --red: #e0533c;
  --red-tint: #fbe9e4;
  --amber-tint: #fdf1dd;
  --amber: #e8a33d;
  --amber-ink: #9a620a;
  --blue-tint: #e8f1fb;
  --solid: #24282a;
  --on-solid: #ffffff;
  --tab-muted: #8a8a85;
  --violet-tint: #f3ecfb;

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 3px rgba(20, 20, 20, .04), 0 12px 28px -16px rgba(20, 20, 20, .16);
  --shadow-fab: 0 8px 20px -4px rgba(53, 200, 119, .55);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "SF Pro Display",
          "Segoe UI", Roboto, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Inline-sprite icons: size comes from context; never let one render at its
   intrinsic 300x150 default. */
svg { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  overscroll-behavior-y: none;
}

.pull-refresh {
  position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 50%; z-index: 80;
  display: flex; align-items: center; gap: 7px; padding: 8px 13px;
  border-radius: 999px; background: var(--solid); color: var(--on-solid);
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translate(-50%, -16px); transition: .16s ease;
}
.pull-refresh.visible { opacity: .8; transform: translate(-50%, 0); }
.pull-refresh.ready { opacity: 1; background: var(--green-ink); }
.pull-refresh.ready span { transform: rotate(180deg); }
.pull-refresh.refreshing { opacity: 1; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 18px calc(120px + var(--safe-b));
  min-height: 100vh;
}

/* ---------------------------------------------------------------- typography */

h1.title { font-size: 32px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.subtitle { color: var(--muted); font-size: 15px; margin: 2px 0 0; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin: 26px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big { font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin: 4px 0; }
.num { font-size: 25px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 0; }
.neg { color: var(--red); }
.pos { color: var(--green-ink); }

/* ---------------------------------------------------------------- header row */

.pagehead {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.pagehead .greeting { font-size: 15px; color: var(--muted); }
.pagehead .name { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }

.iconbtn {
  width: 40px; height: 40px; border-radius: 999px; border: 0;
  background: var(--green-tint); color: var(--green-ink);
  display: grid; place-items: center; flex: none;
}
.iconbtn svg { width: 20px; height: 20px; }

/* month switcher pill */
.monthnav {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 999px; padding: 9px 16px;
  box-shadow: var(--shadow); font-weight: 700; font-size: 15px;
}
.monthnav a { display: grid; place-items: center; width: 24px; height: 24px; color: var(--ink); }
.monthnav svg { width: 18px; height: 18px; }
.monthnav a.disabled { color: var(--muted); pointer-events: none; }

/* segmented control */
.segmented {
  display: flex; background: var(--card); border-radius: 999px; padding: 4px;
  box-shadow: var(--shadow); margin: 14px 0 4px;
}
.segmented a {
  flex: 1; text-align: center; padding: 9px 6px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--muted);
}
.segmented a.on { background: var(--solid); color: var(--on-solid); }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
}
a.card { display: block; color: inherit; }
a.card:active { opacity: .7; }
.card.soft { background: var(--card-soft); box-shadow: none; }
.grid2 > a.card.stat { align-self: stretch; }

.hero {
  text-align: center; padding: 26px 18px 22px;
}
.hero .label { color: var(--muted); font-size: 15px; }
.hero .today-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  background: var(--card-soft); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; color: var(--ink-2); font-weight: 600;
}
.hero .split {
  display: flex; justify-content: center; gap: 18px; margin-top: 4px;
  font-size: 13px; color: var(--muted);
}
.hero .split b { color: var(--ink); font-weight: 700; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.stat .stat-top { display: flex; align-items: center; gap: 10px; }
.stat .stat-top .ic {
  width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center;
  flex: none; font-size: 17px;
}
.stat .stat-label { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.stat .stat-val { font-size: 23px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 8px; }
.stat.dim .stat-val { color: var(--red); }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700;
}
.chip.up { background: var(--red-tint); color: var(--red); }
.chip.down { background: var(--green-tint); color: var(--green-ink); }
.chip.flat { background: var(--card-soft); color: var(--muted); }
.chip-note { font-size: 12px; color: var(--muted); }
.chip + .chip-note { margin-left: 6px; }

/* ---------------------------------------------------------------- category bars */

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.bar-li { display: block; color: inherit; }
a.bar-li:active { opacity: .6; }
.bars .bar-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.bars .bar-row b { font-weight: 700; }
.bar { height: 8px; border-radius: 999px; background: var(--hairline); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; }

/* filters (Inicio) — collapsed behind an icon by default */
.filters { margin: 24px 0 4px; }
.filters > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
}
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary h2 { margin: 0; }
.filter-btn {
  width: 38px; height: 38px; flex: none; border-radius: 999px; display: grid;
  place-items: center; background: var(--card); box-shadow: var(--shadow); color: var(--ink-2);
}
.filter-btn svg { width: 18px; height: 18px; }
.filters[open] .filter-btn, .filter-btn.on { background: var(--solid); color: var(--on-solid); }

.filters-panel { margin-top: 12px; display: grid; gap: 8px; }
.filterbar { display: grid; gap: 8px; }
.seg-mini { display: flex; background: var(--card); border-radius: 999px; padding: 3px;
  box-shadow: var(--shadow); }
.seg-mini label { flex: 1; text-align: center; padding: 8px 4px; border-radius: 999px;
  font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg-mini label.on { background: var(--solid); color: var(--on-solid); }
.seg-mini input { position: absolute; opacity: 0; pointer-events: none; }
.filterbar select { padding: 10px 12px; font-size: 14px; }
.filter-summary { display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 2px 0; }
.filter-summary a { color: var(--red); }

.split-bar { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; }

.acct-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.acct-name { font-weight: 800; font-size: 17px; }
.acct-link { display: block; }
.tagwrap { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }

.actions-row { display: flex; gap: 8px; margin: 14px 0 4px; }
.actions-row .btn { padding: 11px 8px; font-size: 13px; }

.row .row-amt.pos { color: var(--green-ink); }
.row .row-amt.muted { color: var(--muted); font-weight: 600; }
.dayhead .day-total.pos { color: var(--green-ink); }
.dayhead .day-total.neg { color: var(--red); }

/* categorías / cuentas (ajustes) */
.catform-row { display: flex; gap: 8px; margin-bottom: 12px; }
.ic-input { width: 56px !important; text-align: center; flex: none; padding: 12px 6px; }
input[type="color"] {
  width: 46px !important; flex: none; padding: 4px; height: 46px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); background: var(--card);
}
.catlist { display: grid; gap: 4px; }
.catrow {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--hairline);
}
.catrow:last-child { border-bottom: 0; }
.catrow.off { opacity: .5; }
.drag-handle {
  flex: none; cursor: grab; font-size: 17px; line-height: 1; color: var(--muted);
  padding: 4px 2px; touch-action: none; user-select: none; -webkit-user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.catrow.sortable-ghost { opacity: .35; }
.catrow.sortable-chosen { background: var(--card-soft); }
.catrow-edit { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 210px; }
.catrow-edit input:not(.ic-input):not([type="color"]) { flex: 1; min-width: 60px; padding: 9px 10px; }
.catrow-edit .ic-input { padding: 9px 4px; }
.catrow form { margin: 0; }

/* two-tap confirmation for destructive actions */
.confirm > summary { list-style: none; cursor: pointer; display: block; }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm-box {
  margin-top: 8px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--red-tint); display: grid; gap: 10px;
}
.confirm-box p { margin: 0; color: var(--red); font-weight: 600; }
.btn.danger.solid { background: var(--red); color: #fff; }

/* accounts admin */
.acc-summary {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
}
.acc-summary .acc-ic {
  width: 40px; height: 40px; border-radius: 999px; flex: none; display: grid;
  place-items: center; font-size: 18px;
}
.acc-summary .acc-title { font-weight: 700; font-size: 15px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.acc-summary .acc-sub { font-size: 12px; color: var(--muted); }
.acc-summary .acc-bal { margin-left: auto; font-weight: 800; white-space: nowrap; }
details.acc-editor > summary {
  list-style: none; cursor: pointer; font-size: 13px; font-weight: 700;
  color: var(--green-ink); padding: 6px 0 0 50px;
}
details.acc-editor > summary::-webkit-details-marker { display: none; }
details.acc-editor[open] > summary { color: var(--muted); }
.acc-editor-body { margin: 10px 0 0 50px; display: grid; gap: 8px; }
.accrow { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.accrow:last-child { border-bottom: 0; }
.accrow.off { opacity: .5; }
.accrow-top { display: flex; align-items: flex-start; gap: 8px; }
.acc-edit {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; margin: 0;
}
.acc-edit input[name="name"] { flex: 1 1 130px; max-width: 240px; padding: 9px 10px; }
.acc-edit .ic-input { padding: 9px 4px; }
.acc-edit select { flex: 0 1 auto; padding: 8px; font-size: 13px; }
.acc-edit .ob-input { width: 90px; padding: 8px; flex: none; }
.accrow-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-wrap: wrap; margin: 8px 0 0 26px;
}
.accrow-actions { display: flex; gap: 10px; }
.accrow-actions form { margin: 0; }

details.movs { margin-top: 14px; }
details.movs > summary {
  cursor: pointer; list-style: none; user-select: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px; border-radius: var(--radius-sm); background: var(--card-soft);
  font-size: 14px; font-weight: 700; color: var(--ink-2);
}
details.movs > summary::-webkit-details-marker { display: none; }
details.movs > summary .chev { transition: transform .18s ease; font-size: 12px; }
details.movs[open] > summary .chev { transform: rotate(180deg); }
details.movs[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.movs .daygroup:first-of-type { margin-top: 10px; }

.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.people li {
  display: flex; justify-content: space-between; padding: 12px 0;
  border-bottom: 1px solid var(--hairline); font-size: 15px;
}
.people li:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- activity feed */

.daygroup { margin-top: 20px; }
.dayhead {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 4px 8px; font-size: 13px; font-weight: 700; color: var(--muted);
}
.dayhead .day-total { color: var(--red); }

.rows { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border-bottom: 1px solid var(--hairline);
}
.row:last-child { border-bottom: 0; }
.row-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; }
.row .cat-ic {
  width: 42px; height: 42px; border-radius: 999px; flex: none;
  display: grid; place-items: center; font-size: 19px;
}
.row .row-main { flex: 1; min-width: 0; }
.row .row-title {
  display: block; font-weight: 700; font-size: 15px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.row .row-sub {
  display: block; font-size: 12px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex: none; }
.row .row-amt { font-weight: 700; font-size: 15px; white-space: nowrap; }
.row .row-amt.pos { color: var(--green-ink); }
.acct-toggle, .acct-tag {
  border: 0; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 700;
  white-space: nowrap; background: var(--card-soft); color: var(--muted);
}
.acct-toggle.common, .acct-tag.common { background: var(--green-tint); color: var(--green-ink); }

/* inbox — uncategorised, needs a tap */
.inbox { margin-bottom: 8px; }
.inbox .inbox-head {
  display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px;
  font-size: 13px; font-weight: 700; color: var(--red);
}
.inbox .row { background: transparent; }
.chips-row {
  display: flex; gap: 7px; padding: 10px 12px 14px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }
.catchip {
  flex: none; border: 1px solid var(--hairline); background: var(--card-soft);
  border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600;
  display: inline-flex; gap: 5px; align-items: center;
}

/* ---------------------------------------------------------------- forms */

form.stack { display: grid; gap: 16px; }
label.field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
select, textarea {
  font: inherit; width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--hairline); background: var(--card); color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
input[type="file"] { font: inherit; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: transparent; }
.amount-input { font-size: 30px; font-weight: 800; text-align: center; letter-spacing: -.02em; }

/* two-option chooser (e.g. cuenta: mía / común) */
.chips-pick.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips-pick.two label { justify-content: center; padding: 12px; border-radius: var(--radius-sm); }

.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-pick input { display: none; }
.chips-pick label {
  border: 1px solid var(--hairline); border-radius: 999px; padding: 9px 13px;
  font-size: 14px; font-weight: 600; display: inline-flex; gap: 5px; align-items: center;
}
.chips-pick input:checked + label { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }

.btn {
  display: block; width: 100%; text-align: center; border: 0; border-radius: var(--radius-sm);
  padding: 15px; font-size: 16px; font-weight: 700; background: var(--green); color: #fff;
}
.btn.ghost { background: var(--card-soft); color: var(--ink); }
.btn.danger { background: var(--red-tint); color: var(--red); }
.btn.link { background: none; color: var(--muted); width: auto; padding: 6px; font-weight: 600; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  background: var(--card); font-weight: 600; color: var(--ink-2);
}

/* ---------------------------------------------------------------- login */

.login { max-width: 360px; margin: 12vh auto 0; text-align: center; display: grid; gap: 14px; }
.login h1 { font-size: 26px; font-weight: 800; margin: 0; }
.login form { display: grid; gap: 12px; }
.error { color: var(--red); font-weight: 600; }
code { background: var(--card-soft); padding: 2px 6px; border-radius: 6px; font-size: .85em; }

/* ---------------------------------------------------------------- banner */

.banner {
  display: block; background: var(--amber-tint); border-radius: var(--radius-sm);
  padding: 13px 15px; font-size: 14px; font-weight: 600; margin: 14px 0 4px; color: var(--amber-ink);
}

/* ---------------------------------------------------------------- tab bar */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--hairline);
  padding: 8px 6px calc(8px + var(--safe-b));
  max-width: 480px; margin: 0 auto;
}
.tabbar a {
  flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 0;
  font-size: 10.5px; font-weight: 600; color: var(--tab-muted);
}
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.fab {
  flex: none; width: 58px; height: 58px; border-radius: 999px;
  background: linear-gradient(180deg, #3ed985, #2fb96c);
  color: #fff; display: grid; place-items: center; transform: translateY(-14px);
  box-shadow: var(--shadow-fab); font-size: 0;
}
.tabbar a.fab svg { width: 26px; height: 26px; }

/* utilities */
.mt0 { margin-top: 0; }
.center { text-align: center; }
.row-link { display: contents; }
hr.sep { border: 0; border-top: 1px solid var(--hairline); margin: 22px 0; }

/* ---------------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 60;
  transform: translateX(-50%); background: var(--solid); color: var(--on-solid);
  padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 700;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45); white-space: nowrap;
  animation: toast 2.8s ease forwards; pointer-events: none;
}
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, 12px); }
  10%, 80% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 8px); }
}

/* ---------------------------------------------------------------- settings list */
.card.settings { padding: 4px 16px; }
.set-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0; color: inherit;
  border-bottom: 1px solid var(--hairline); list-style: none; cursor: pointer;
}
.settings > .set-row:last-child, .settings > details:last-child > summary { border-bottom: 0; }
.set-row::-webkit-details-marker { display: none; }
/* A card that is itself a settings row (e.g. "Ponte un presupuesto"): `a.card` sets
   display:block, so restore the row layout. */
a.card.set-row { display: flex; border-bottom: 0; }
.set-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  font-size: 18px; flex: none; }
.set-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.set-main b { font-size: 15px; }
.set-main small { font-size: 12.5px; color: var(--muted); }
.set-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .18s ease; }
details[open] > summary .chev-down { transform: rotate(90deg); }
details.reveal > summary { list-style: none; }
details.reveal > summary::-webkit-details-marker { display: none; }
.reveal-body { display: grid; gap: 10px; padding: 10px 0 14px; }
.card:not(.settings) .reveal-body { padding-bottom: 0; }

/* ---------------------------------------------------------------- onboarding */
.onboard { margin-top: 14px; display: grid; gap: 4px; padding-top: 12px; }
.onboard-head { display: flex; justify-content: space-between; align-items: center; }
.onboard-head form { margin: 0; }
.step { display: flex; gap: 12px; align-items: center; padding: 10px 0; color: inherit;
  border-top: 1px solid var(--hairline); }
.step-n { width: 30px; height: 30px; border-radius: 999px; flex: none; display: grid;
  place-items: center; font-weight: 800; font-size: 14px; background: var(--green-tint);
  color: var(--green-ink); }
.step.ok .step-n { background: var(--green); color: #fff; }
.step.ok .step-txt b { text-decoration: line-through; color: var(--muted); }
.step-txt { display: grid; gap: 1px; }
.step-txt small { color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- empty states */
.empty-state { text-align: center; padding: 26px 10px; display: grid; gap: 8px;
  justify-items: center; }
.empty-state p { margin: 0; }
.empty-ic { font-size: 38px; line-height: 1; }
.empty-actions { display: grid; gap: 8px; width: 100%; max-width: 320px; margin-top: 6px; }
.error-ic { font-size: 46px; line-height: 1; }

/* ---------------------------------------------------------------- 6-month trend */
.trend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; align-items: end;
  height: 150px; }
.trend-col { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px;
  color: var(--muted); text-align: center; font-size: 12px; font-weight: 600;
  border-radius: 10px; padding: 4px 2px 2px; }
.trend-col.cur { background: var(--card-soft); color: var(--ink); }
.trend-bars { display: flex; justify-content: center; align-items: flex-end; gap: 3px;
  height: 100%; }
.trend-bars i { display: block; width: 32%; max-width: 14px; min-height: 2px;
  border-radius: 6px 6px 2px 2px; }
.trend-bars .inc { background: var(--green); }
.trend-bars .exp { background: var(--red); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px;
  font-size: 12.5px; color: var(--ink-2); align-items: center; }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  margin-right: 5px; vertical-align: -1px; }
.legend-row .muted { margin-left: auto; }

.acc-dot { width: 12px; height: 12px; border-radius: 999px; margin-left: auto; flex: none; }

.card + .monthnav { margin-top: 14px; }
.bars .bar-ic { margin-right: 7px; }

/* ---------------------------------------------------------------- budgets */
.bar > i.lvl-ok { background: var(--green); }
.bar > i.lvl-warn { background: var(--amber); }
.bar > i.lvl-over { background: var(--red); }
.bud-note { font-size: 12px; font-weight: 600; margin-top: 5px; color: var(--muted); }
.bud-note.lvl-warn { color: var(--amber-ink); }
.bud-note.lvl-over { color: var(--red); }
.bud-of { font-weight: 600; font-size: 12.5px; }
.bud-list { padding: 4px 16px; }
.bud-row { display: flex; align-items: center; gap: 12px; padding: 10px 0;
  border-top: 1px solid var(--hairline); }
.bud-list > .bud-row:first-child { border-top: 0; }
.bud-row .cat-ic { width: 38px; height: 38px; border-radius: 999px; flex: none; display: grid;
  place-items: center; font-size: 18px; }
.bud-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.bud-main b { font-size: 15px; }
.bud-main small { font-size: 12px; color: var(--muted); }
/* !important: the global text-input rule (width 100%) is more specific than a class. */
input.bud-input { width: 104px !important; flex: none; text-align: right;
  padding: 9px 10px !important; font-weight: 700; }
.bud-eur { color: var(--muted); font-weight: 600; margin-left: -6px; }
.bud-progress { padding: 0 0 12px 50px; }
.budget-alert { margin-top: 14px; display: grid; gap: 8px; }
.ba-head { display: flex; justify-content: space-between; align-items: center; }
.ba-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px;
  font-weight: 600; }
.ba-line.lvl-warn span:last-child { color: var(--amber-ink); }
.ba-line.lvl-over span:last-child { color: var(--red); }

/* ---------------------------------------------------------------- forms: pairs + checkbox */
.filter-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; flex: none;
  accent-color: var(--green); }
.check-row small { font-weight: 500; }

/* ---------------------------------------------------------------- recurring */
.fixed-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center;
  padding: 14px 10px; }
.fixed-sum > div { display: grid; gap: 2px; }
.fixed-sum b { font-size: 17px; letter-spacing: -.01em; }
.acc-summary .cat-ic { width: 40px; height: 40px; border-radius: 999px; flex: none; display: grid;
  place-items: center; font-size: 18px; }

/* ---------------------------------------------------------------- net worth evolution */
.nw-card { margin-top: 14px; }
.nw-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
svg.spark { width: 100%; height: 90px; display: block; margin-top: 10px; overflow: visible; }
.spark-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linejoin: round;
  stroke-linecap: round; }
.spark-area { fill: color-mix(in srgb, var(--green) 14%, transparent); stroke: none; }
.spark-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600;
  color: var(--muted); margin-top: 4px; }
.spark-labels .cur { color: var(--ink); }
.chip.good { background: var(--green-tint); color: var(--green-ink); }
.chip.bad { background: var(--red-tint); color: var(--red); }
.export-btns { grid-template-columns: 1fr 1fr; }
.filterbar input[type="search"] { padding: 11px 14px; font-size: 15px; }

/* ---------------------------------------------------------------- dark mode
   Follows the iPhone's appearance unless the viewer picked Claro/Oscuro in Ajustes,
   which sets <html data-theme="light|dark"> (see base.html and app.js). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e100f;
  --card: #191c1a;
  --card-soft: #222623;
  --ink: #f1f2ee;
  --ink-2: #c7c9c3;
  --muted: #979a93;
  --hairline: #2a2e2b;
  --green: #3ccf7f;
  --green-ink: #62d998;
  --green-tint: #1b3024;
  --red: #ff6f57;
  --red-tint: #3b211c;
  --amber: #f0b04c;
  --amber-ink: #f2c374;
  --amber-tint: #382c16;
  --blue-tint: #1b2838;
  --violet-tint: #2a2036;
  --solid: #f1f2ee;
  --on-solid: #111312;
  --tab-muted: #7f827c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 28px -18px rgba(0, 0, 0, .8);
  --shadow-fab: 0 8px 22px -6px rgba(0, 0, 0, .7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e100f;
    --card: #191c1a;
    --card-soft: #222623;
    --ink: #f1f2ee;
    --ink-2: #c7c9c3;
    --muted: #979a93;
    --hairline: #2a2e2b;
    --green: #3ccf7f;
    --green-ink: #62d998;
    --green-tint: #1b3024;
    --red: #ff6f57;
    --red-tint: #3b211c;
    --amber: #f0b04c;
    --amber-ink: #f2c374;
    --amber-tint: #382c16;
    --blue-tint: #1b2838;
    --violet-tint: #2a2036;
    --solid: #f1f2ee;
    --on-solid: #111312;
    --tab-muted: #7f827c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 28px -18px rgba(0, 0, 0, .8);
    --shadow-fab: 0 8px 22px -6px rgba(0, 0, 0, .7);
  }
}
