/* =====================================================================
   Aspectos de la app: A «Noche», B «Color», C «Minimal».
   Se elige en ⚙️ Ajustes › Aspecto (se guarda en el móvil).
   ===================================================================== */

/* ---------------------------------------------------------------------
   A · NOCHE — oscuro y vibrante. Azul tinta profundo, tarjetas con relieve,
   el color de cada categoría como protagonista y una cabecera en degradado.
   --------------------------------------------------------------------- */
:root[data-theme="a"] {
  --bg: #0f1626;
  --card: #18223a;
  --ink: #eef2fb;
  --muted: #8f9bb8;
  --line: #26324f;
  --accent: #7c6cff;
  --accent-soft: #2a2758;
  --gasto: #ff7a8a;
  --ingreso: #4be0a6;
  --ahorro: #5cc8ff;
  --warn: #ffc857;
  --shadow: 0 8px 24px rgba(3, 8, 20, .45);
  color-scheme: dark;
}
:root[data-theme="a"] body { font-family: "Inter Display", Inter, Roboto, system-ui, sans-serif; }
:root[data-theme="a"] .topbar { background: var(--bg); border-bottom-color: transparent; }
:root[data-theme="a"] .topbar h1 { font-weight: 800; font-size: 1.35rem; }
:root[data-theme="a"] .card { border: 0; background: var(--card); }
:root[data-theme="a"] .hero { --hero-bg: linear-gradient(140deg, #5b3dff 0%, #8f4dff 50%, #19a3c9 100%); --hero-in: #8ff5c8; box-shadow: 0 14px 34px rgba(106, 77, 255, .35); }
:root[data-theme="a"] .seg { background: #121b2e; }
:root[data-theme="a"] .seg button.on { background: var(--card); box-shadow: none; }
:root[data-theme="a"] .amount { border-bottom-color: var(--line); }
:root[data-theme="a"] .amount input { font-size: 3rem; font-weight: 800; }
:root[data-theme="a"] .plus-btn { background: var(--accent); color: #fff; border: 0; border-radius: 50%; }
:root[data-theme="a"] .chip { background: var(--card); border-color: transparent; }
:root[data-theme="a"] .chips.cats .chip { border-radius: 16px; min-height: 50px; }
:root[data-theme="a"] .chips.cats .chip .ic {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem;
  background: color-mix(in srgb, var(--c) 35%, transparent);
}
:root[data-theme="a"] .chip.on { background: color-mix(in srgb, var(--c, var(--accent)) 30%, var(--card)); border-color: var(--c, var(--accent)); }
:root[data-theme="a"] .chip.quick { border-style: solid; border-color: var(--line); background: transparent; }
:root[data-theme="a"] .input { background: #121b2e; border-color: var(--line); }
:root[data-theme="a"] .btn { background: var(--card); border-color: var(--line); }
:root[data-theme="a"] .btn.primary { background: linear-gradient(135deg, #6a4dff, #8f4dff); border: 0; box-shadow: 0 8px 20px rgba(106, 77, 255, .35); }
:root[data-theme="a"] .mov .ic { border-radius: 50%; background: color-mix(in srgb, var(--c) 32%, transparent); }
:root[data-theme="a"] .mov { border-top-color: rgba(255,255,255,.05); }
:root[data-theme="a"] .bar, :root[data-theme="a"] .pace-bar, :root[data-theme="a"] .goal-bar { background: #0f1626; }
:root[data-theme="a"] .bar > i, :root[data-theme="a"] .pace-bar > i { background: linear-gradient(90deg, #6a4dff, #19b5c9); }
:root[data-theme="a"] .bar.alerta > i { background: var(--warn); }
:root[data-theme="a"] .bar.excedido > i, :root[data-theme="a"] .pace.over .pace-bar > i { background: linear-gradient(90deg, #ff5f7e, #ff9a62); }
:root[data-theme="a"] .kpi .v { font-size: 1.45rem; font-weight: 800; }
:root[data-theme="a"] .tag.ok { background: rgba(75, 224, 166, .14); color: var(--ingreso); }
:root[data-theme="a"] .tabs {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 64px; padding: 0;
  border-radius: 22px; border: 1px solid var(--line); background: rgba(24, 34, 58, .92); backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
:root[data-theme="a"] .tabs button.active { color: #fff; }
:root[data-theme="a"] .tabs button.active svg { stroke: #a99bff; }
:root[data-theme="a"] body { padding-bottom: calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); }
:root[data-theme="a"] .toast { bottom: calc(var(--tabs-h) + 30px + env(safe-area-inset-bottom)); background: #2a3556; }
:root[data-theme="a"] dialog#modal { background: #141d31; }
:root[data-theme="a"] .fijos-banner { background: rgba(124, 108, 255, .14); }
:root[data-theme="a"] .saved-tick span { background: linear-gradient(135deg, #6a4dff, #19b5c9); }

/* ---------------------------------------------------------------------
   B · COLOR — claro y alegre. Cada categoría es una ficha de su color con el
   icono grande; barras gruesas; un ✓ que rebota al guardar.
   --------------------------------------------------------------------- */
:root[data-theme="b"] {
  --bg: #f1f4ff;
  --card: #ffffff;
  --ink: #1f2140;
  --muted: #6c7096;
  --line: #e2e6f5;
  --accent: #4b5cf0;
  --accent-soft: #e3e6ff;
  --gasto: #e8506a;
  --ingreso: #14a06b;
  --ahorro: #1d8fe0;
  --warn: #e69b00;
  --radius: 20px;
  --shadow: 0 2px 0 #e2e6f5;
  color-scheme: light;
}
:root[data-theme="b"] body { font-family: "Inter Display", Inter, Roboto, system-ui, sans-serif; }
:root[data-theme="b"] .topbar { background: var(--bg); border-bottom: 0; }
:root[data-theme="b"] .topbar h1 { font-weight: 800; font-size: 1.4rem; }
:root[data-theme="b"] .card { border: 0; box-shadow: var(--shadow); }
:root[data-theme="b"] .hero {
  /* índigo a juego con el fondo azul claro y los botones */
  --hero-bg: linear-gradient(150deg, #262f8f 0%, #3a47c9 55%, #5b6cf5 100%);
  --hero-in: #7ff0c0; --hero-bar: rgba(255,255,255,.45);
  box-shadow: 0 4px 0 #1c2370, 0 12px 28px rgba(59, 72, 201, .28);
}
:root[data-theme="b"] .seg { background: #e2e6f5; border-radius: 16px; }
:root[data-theme="b"] .seg button { border-radius: 13px; font-weight: 600; }
:root[data-theme="b"] .amount { border: 0; background: var(--card); border-radius: 22px; padding: 10px 18px; box-shadow: var(--shadow); }
:root[data-theme="b"] .amount input { font-size: 2.8rem; font-weight: 800; }
:root[data-theme="b"] .plus-btn { border-radius: 18px; width: 62px; height: 62px; border: 0; background: var(--accent); color: #fff; box-shadow: 0 3px 0 #2f3fc4; }
:root[data-theme="b"] .chips.cats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
:root[data-theme="b"] .chips.cats .chip {
  flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 4px;
  min-height: 68px; padding: 8px 6px; border-radius: 18px; border: 2px solid transparent;
  background: color-mix(in srgb, var(--c) 18%, #fff); font-size: .76rem; font-weight: 600;
}
:root[data-theme="b"] .chips.cats .chip .ic { font-size: 1.45rem; }
:root[data-theme="b"] .chips.cats .chip .lbl { white-space: normal; line-height: 1.15; }
:root[data-theme="b"] .chips.cats .chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 34%, #fff); transform: translateY(-1px); }
:root[data-theme="b"] .chip { border: 0; background: var(--card); box-shadow: var(--shadow); }
:root[data-theme="b"] .chip.on { background: color-mix(in srgb, var(--c, var(--accent)) 26%, #fff); box-shadow: 0 0 0 2px var(--c, var(--accent)); }
:root[data-theme="b"] .chip.quick { border: 0; background: color-mix(in srgb, var(--c) 14%, #fff); box-shadow: none; }
:root[data-theme="b"] .input { border: 0; box-shadow: var(--shadow); border-radius: 16px; }
:root[data-theme="b"] .btn { border: 0; box-shadow: var(--shadow); border-radius: 16px; }
:root[data-theme="b"] .btn.primary { background: var(--accent); box-shadow: 0 4px 0 #2f3fc4; }
:root[data-theme="b"] .btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #2f3fc4; }
:root[data-theme="b"] .mov .ic { border-radius: 14px; background: color-mix(in srgb, var(--c) 22%, #fff); font-size: 1.3rem; width: 44px; height: 44px; }
:root[data-theme="b"] .bar { height: 14px; background: #edf0fb; }
:root[data-theme="b"] .bud-sub .bar { height: 8px; }
:root[data-theme="b"] .bar > i { background: #22b07d; }
:root[data-theme="b"] .pace-bar { height: 18px; background: #edf0fb; }
:root[data-theme="b"] .pace-bar > i { background: #22b07d; }
:root[data-theme="b"] .kpi:nth-child(1) { background: #dcf7ea; } :root[data-theme="b"] .kpi:nth-child(2) { background: #ffe3e8; }
:root[data-theme="b"] .kpi:nth-child(3) { background: #ddefff; } :root[data-theme="b"] .kpi:nth-child(4) { background: #fff3c4; }
:root[data-theme="b"] .kpi { box-shadow: none; }
:root[data-theme="b"] .kpi .v { font-size: 1.45rem; font-weight: 800; }
:root[data-theme="b"] .tag { padding: 3px 9px; }
:root[data-theme="b"] .tabs { border-top: 0; box-shadow: 0 -2px 0 #e2e6f5; }
:root[data-theme="b"] .tabs button.active { color: var(--accent); }
:root[data-theme="b"] .tabs button.active svg { background: var(--accent-soft); border-radius: 12px; padding: 4px 14px; width: 40px; height: 32px; box-sizing: content-box; margin: -4px 0; }
:root[data-theme="b"] .goal-bar { height: 22px; }
:root[data-theme="b"] .goal-bar > span { line-height: 22px; }
:root[data-theme="b"] .saved-tick span { background: #22b07d; }
:root[data-theme="b"] .fijos-banner { background: #e3e6ff; border: 0; }
:root[data-theme="b"] .toast { border-radius: 16px; background: var(--ink); }

/* ---------------------------------------------------------------------
   C · MINIMAL — mucho aire, un solo acento, cifras grandes y finas.
   Sin tarjetas: separadores de un pixel. Sigue el modo claro/oscuro del móvil.
   --------------------------------------------------------------------- */
:root[data-theme="c"] {
  --bg: #ffffff;
  --card: #ffffff;
  --ink: #111318;
  --muted: #868b96;
  --line: #ececef;
  --accent: #1f5eff;
  --accent-soft: #e8eeff;
  --gasto: #111318;
  --ingreso: #1f8a55;
  --ahorro: #1f5eff;
  --warn: #c88400;
  --radius: 0;
  --shadow: none;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="c"] {
    --bg: #000000; --card: #000000; --ink: #f4f5f7; --muted: #8b909b; --line: #1f2024;
    --accent: #5b8cff; --accent-soft: #101a33; --gasto: #f4f5f7; --ingreso: #4cc98a; --ahorro: #5b8cff; color-scheme: dark;
  }
}
:root[data-theme="c"] body { font-family: "Inter Display", Inter, Roboto, system-ui, sans-serif; }
:root[data-theme="c"] .topbar { border-bottom: 0; }
:root[data-theme="c"] .topbar h1 { font-weight: 500; font-size: 1.05rem; }
:root[data-theme="c"] .card { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
:root[data-theme="c"] .card.kpi, :root[data-theme="c"] .goal, :root[data-theme="c"] .pace, :root[data-theme="c"] .search-sum { border: 1px solid var(--line); border-radius: 14px; }
:root[data-theme="c"] .hero { --hero-bg: #111318; --hero-in: #6fe0a5; box-shadow: none; border-radius: 22px; }
:root[data-theme="c"] .hero-v { font-weight: 300; letter-spacing: -.04em; }
:root[data-theme="c"] .seg { background: transparent; border: 1px solid var(--line); border-radius: 99px; }
:root[data-theme="c"] .seg button { border-radius: 99px; }
:root[data-theme="c"] .seg button.on { background: var(--ink); color: var(--bg) !important; box-shadow: none; }
:root[data-theme="c"] .amount { border-bottom-width: 1px; }
:root[data-theme="c"] .amount input { font-size: 3.4rem; font-weight: 250; letter-spacing: -.04em; }
:root[data-theme="c"] .amount span { font-weight: 250; }
:root[data-theme="c"] .plus-btn { background: transparent; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-weight: 300; }
:root[data-theme="c"] h3 { text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 500; }
:root[data-theme="c"] h2 { font-weight: 500; }
:root[data-theme="c"] .chip { border-radius: 99px; background: transparent; }
:root[data-theme="c"] .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
:root[data-theme="c"] .chips.cats .chip { border-radius: 12px; }
:root[data-theme="c"] .input { border-radius: 12px; }
:root[data-theme="c"] .btn { border-radius: 99px; }
:root[data-theme="c"] .btn.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
:root[data-theme="c"] .mov { padding-left: 2px; padding-right: 2px; }
:root[data-theme="c"] .mov .ic { background: transparent; border: 1px solid var(--line); border-radius: 50%; }
:root[data-theme="c"] .mov .a.c-gasto { font-weight: 500; }
:root[data-theme="c"] .day .card, :root[data-theme="c"] .bud, :root[data-theme="c"] .catcard { border-left: 0; border-right: 0; }
:root[data-theme="c"] .bar { height: 3px; }
:root[data-theme="c"] .bar > i { background: var(--ink); }
:root[data-theme="c"] .bar.alerta > i { background: var(--warn); }
:root[data-theme="c"] .bar.excedido > i { background: #e5484d; }
:root[data-theme="c"] .tag { background: transparent !important; padding: 0; font-weight: 500; }
:root[data-theme="c"] .tag.excedido { color: #e5484d; }
:root[data-theme="c"] .pace-bar { height: 4px; }
:root[data-theme="c"] .pace-bar > i { background: var(--ink); }
:root[data-theme="c"] .pace.over .pace-bar > i { background: #e5484d; }
:root[data-theme="c"] .pace.over .pace-msg b { color: #e5484d; }
:root[data-theme="c"] .kpi .v { font-weight: 300; font-size: 1.5rem; }
:root[data-theme="c"] .c-gasto { color: var(--ink); }
:root[data-theme="c"] .goal-bar { height: 6px; }
:root[data-theme="c"] .goal-bar > span { display: none; }
:root[data-theme="c"] .goal-bar > i { background: var(--accent); }
:root[data-theme="c"] .goal-ic { background: transparent; border: 1px solid var(--line); border-radius: 50%; }
:root[data-theme="c"] .tabs { border-top: 1px solid var(--line); background: var(--bg); }
:root[data-theme="c"] .tabs button { font-size: .7rem; }
:root[data-theme="c"] .tabs button.active { color: var(--ink); font-weight: 500; }
:root[data-theme="c"] .tabs button svg { stroke-width: 1.4; }
:root[data-theme="c"] .tabs button.active svg { stroke-width: 2; }
:root[data-theme="c"] .catcard-h { border-left: 0; }
:root[data-theme="c"] .catcard-h::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
:root[data-theme="c"] .fijos-banner { border: 1px solid var(--line); border-radius: 14px; background: transparent; }
:root[data-theme="c"] .saved-tick span { background: var(--ink); color: var(--bg); }
:root[data-theme="c"] .toast { border-radius: 99px; background: var(--ink); color: var(--bg); }
:root[data-theme="c"] dialog#modal { border-radius: 20px 20px 0 0; }

/* elección de aspecto en Ajustes */
.theme-pick { margin-top: 4px; }

/* ---------- escritorio (≥ 900 px): menú lateral en los tres aspectos ---------- */
@media (min-width: 900px) {
  :root[data-theme="a"] body { padding-bottom: 0; padding-left: calc(var(--side) + 24px); }
  :root[data-theme="a"] .tabs { left: 12px; top: 12px; bottom: 12px; right: auto; width: var(--side); height: auto; padding: 18px 14px; border-radius: 22px; }
  :root[data-theme="a"] .tabs button.active { background: rgba(124, 108, 255, .18); }
  :root[data-theme="a"] .toast { bottom: 24px; }
  :root[data-theme="b"] .tabs { box-shadow: 2px 0 0 #e2e6f5; background: var(--card); }
  :root[data-theme="b"] .tabs button.active svg { background: none; padding: 0; width: 24px; height: 24px; margin: 0; }
  :root[data-theme="c"] .tabs { border-top: 0; border-right: 1px solid var(--line); }
  :root[data-theme="c"] .tabs button.active { background: var(--line); }
}

/* ---------------------------------------------------------------------
   D · ÁMBAR — oscuro casi negro con acento dorado, cabeceras grandes con
   antetítulo en mayúsculas y tarjetas con borde fino. (Por defecto.)
   --------------------------------------------------------------------- */
:root[data-theme="d"] {
  --bg: #0b0e13;
  --card: #141820;
  --ink: #f2f0ea;
  --muted: #8a93a3;
  --line: #232934;
  --accent: #f4b53f;
  --accent-soft: rgba(244, 181, 63, .14);
  --gasto: #ff6b6b;
  --ingreso: #3fd08f;
  --ahorro: #5aa9ff;
  --warn: #f4b53f;
  --radius: 16px;
  --shadow: none;
  color-scheme: dark;
}
:root[data-theme="d"] body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: radial-gradient(1200px 500px at 70% -10%, rgba(244,181,63,.06), transparent 60%), var(--bg); background-attachment: fixed; }
:root[data-theme="d"] h2 { font-family: "Inter Tight", Inter, sans-serif; font-weight: 700; letter-spacing: -.01em; }
:root[data-theme="d"] .topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom-color: transparent; }
:root[data-theme="d"] .card { background: var(--card); border: 1px solid var(--line); }
:root[data-theme="d"] .hero {
  --hero-bg: radial-gradient(120% 140% at 100% 0%, rgba(244,181,63,.28), transparent 55%), linear-gradient(160deg, #1b2029, #12161d);
  --hero-in: #5be3a5; --hero-bar: rgba(244,181,63,.55);
  border: 1px solid #2b313c; box-shadow: 0 12px 30px rgba(0,0,0,.35);
}
:root[data-theme="d"] .hero-bars i.today, :root[data-theme="d"] .hero-bars i.today::before { background: var(--accent); }
:root[data-theme="d"] .seg { background: #0f1319; border: 1px solid var(--line); }
:root[data-theme="d"] .seg button.on { background: #1d222b; color: var(--ink); box-shadow: inset 0 0 0 1px #2c3340; }
:root[data-theme="d"] .seg button.on[data-tipo="gasto"] { color: var(--gasto); }
:root[data-theme="d"] .seg button.on[data-tipo="ingreso"] { color: var(--ingreso); }
:root[data-theme="d"] .seg button.on[data-tipo="ahorro"] { color: var(--ahorro); }
:root[data-theme="d"] .amount input { font-family: "Inter Tight", Inter, sans-serif; font-weight: 800; }
:root[data-theme="d"] .plus-btn { background: var(--accent-soft); color: var(--accent); border-color: rgba(244,181,63,.35); }
:root[data-theme="d"] .chip { background: var(--card); border-color: var(--line); }
:root[data-theme="d"] .chip.on { background: color-mix(in srgb, var(--c, var(--accent)) 22%, var(--card)); border-color: var(--c, var(--accent)); }
:root[data-theme="d"] .chips.cats .chip { border-radius: 14px; }
:root[data-theme="d"] .input { background: #0f1319; border-color: var(--line); }
:root[data-theme="d"] .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
:root[data-theme="d"] .btn { background: #1a1f28; border-color: var(--line); }
:root[data-theme="d"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #1a1405; box-shadow: 0 6px 18px rgba(244,181,63,.22); }
:root[data-theme="d"] .btn.primary:hover { filter: brightness(1.06); }
:root[data-theme="d"] .mov .ic { border-radius: 12px; background: color-mix(in srgb, var(--c) 24%, transparent); }
:root[data-theme="d"] .bar, :root[data-theme="d"] .pace-bar, :root[data-theme="d"] .goal-bar { background: #0f1319; }
:root[data-theme="d"] .bar > i, :root[data-theme="d"] .pace-bar > i { background: var(--ingreso); }
:root[data-theme="d"] .bar.alerta > i { background: var(--warn); }
:root[data-theme="d"] .bar.excedido > i, :root[data-theme="d"] .pace.over .pace-bar > i { background: var(--gasto); }
:root[data-theme="d"] .goal-bar > i { background: linear-gradient(90deg, #d99a22, var(--accent)); }
:root[data-theme="d"] .goal-bar > span { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
:root[data-theme="d"] .kpi .v, :root[data-theme="d"] .nw-v, :root[data-theme="d"] .big-num, :root[data-theme="d"] .fc-v { font-family: "Inter Tight", Inter, sans-serif; font-weight: 800; }
:root[data-theme="d"] .tag.ok { background: rgba(63,208,143,.14); color: var(--ingreso); }
:root[data-theme="d"] .networth { background: radial-gradient(90% 120% at 100% 0%, rgba(244,181,63,.14), transparent 60%), var(--card); }
:root[data-theme="d"] .sp-a { fill: rgba(244,181,63,.14); }
:root[data-theme="d"] .sp-l { stroke: var(--accent); }
:root[data-theme="d"] .sp-p { fill: var(--accent); }
:root[data-theme="d"] .fijos-banner { background: rgba(244,181,63,.08); border-color: rgba(244,181,63,.35); }
:root[data-theme="d"] .fb-go, :root[data-theme="d"] .addsub, :root[data-theme="d"] .search-open { color: var(--accent); }
:root[data-theme="d"] .tabs { background: rgba(14,17,23,.96); border-top-color: var(--line); backdrop-filter: blur(10px); }
:root[data-theme="d"] .tabs button.active { color: var(--accent); }
:root[data-theme="d"] .toast { background: #222833; border: 1px solid #2f3643; }
:root[data-theme="d"] .toast button { color: var(--accent); }
:root[data-theme="d"] dialog#modal { background: #12161d; border: 1px solid var(--line); }
:root[data-theme="d"] .saved-tick span { background: var(--accent); color: #1a1405; }
:root[data-theme="d"] code { background: #1f2530; color: #c9cfda; }
@media (min-width: 900px) {
  :root[data-theme="d"] .tabs { background: #0e1117; border-right: 1px solid var(--line); }
  :root[data-theme="d"] .tabs::before { color: var(--ink); }
  :root[data-theme="d"] .tabs > button { color: #a3abb9; }
  :root[data-theme="d"] .tabs > button.active { background: rgba(244,181,63,.12); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(244,181,63,.35); }
  :root[data-theme="d"] .tabs > button[data-tab="add"]:not(.active) { background: var(--accent); color: #1a1405; font-weight: 600; margin-bottom: 8px; }
  :root[data-theme="d"] .tabs > button[data-tab="add"].active { margin-bottom: 8px; }
}

/* ---------------------------------------------------------------------
   E · ARENA — claro y cálido: fondo hueso, tarjetas blancas con borde
   fino, acento caramelo y verde bosque. (Por defecto.)
   --------------------------------------------------------------------- */
:root[data-theme="e"] {
  --bg: #f6f5f1;
  --card: #fefdfc;
  --ink: #0b0f14;
  --muted: #5b6472;
  --line: #e3e0d8;
  --accent: #a35f00;
  --accent-soft: #f5ede1;
  --gasto: #c23a2b;
  --ingreso: #0b7d59;
  --ahorro: #2f6db5;
  --warn: #c27a00;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(40, 30, 10, .04);
  color-scheme: light;
}
:root[data-theme="e"] body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:root[data-theme="e"] h2 { font-family: "Inter Tight", "Inter Display", Inter, sans-serif; font-weight: 700; letter-spacing: -.01em; }
:root[data-theme="e"] .overline { color: #3a3f47; }
:root[data-theme="e"] .topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom-color: transparent; }
:root[data-theme="e"] .card { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
:root[data-theme="e"] .hero {
  --hero-bg: radial-gradient(120% 140% at 100% 0%, rgba(245,165,36,.35), transparent 55%), linear-gradient(150deg, #2f2210 0%, #5a3a0e 55%, #a35f00 100%);
  --hero-in: #8ff0c4; --hero-bar: rgba(255,226,180,.55);
  box-shadow: 0 10px 26px rgba(163, 95, 0, .22);
}
:root[data-theme="e"] .seg { background: #eeece6; border: 1px solid var(--line); }
:root[data-theme="e"] .seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(40,30,10,.08); }
:root[data-theme="e"] .seg button.on[data-tipo="gasto"] { color: var(--gasto); }
:root[data-theme="e"] .seg button.on[data-tipo="ingreso"] { color: var(--ingreso); }
:root[data-theme="e"] .seg button.on[data-tipo="ahorro"] { color: var(--ahorro); }
:root[data-theme="e"] .amount input { font-family: "Inter Tight", "Inter Display", Inter, sans-serif; font-weight: 800; }
:root[data-theme="e"] .plus-btn { background: var(--accent-soft); color: var(--accent); border-color: #ecd9bb; }
:root[data-theme="e"] .chip { background: var(--card); border-color: var(--line); }
:root[data-theme="e"] .chip.on { background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--card)); border-color: var(--c, var(--accent)); }
:root[data-theme="e"] .chips.cats .chip { border-radius: 14px; }
:root[data-theme="e"] .input { background: var(--card); border-color: var(--line); }
:root[data-theme="e"] .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
:root[data-theme="e"] .btn { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
:root[data-theme="e"] .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(163, 95, 0, .28); }
:root[data-theme="e"] .btn.primary:hover { filter: brightness(1.07); }
:root[data-theme="e"] .mov .ic, :root[data-theme="e"] .fx-ic { border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, #fff); }
:root[data-theme="e"] .bar, :root[data-theme="e"] .pace-bar, :root[data-theme="e"] .goal-bar, :root[data-theme="e"] .fx-bar, :root[data-theme="e"] .rule-bar { background: #eeece6; }
:root[data-theme="e"] .bar > i, :root[data-theme="e"] .pace-bar > i { background: var(--ingreso); }
:root[data-theme="e"] .bar.alerta > i { background: var(--warn); }
:root[data-theme="e"] .bar.excedido > i, :root[data-theme="e"] .pace.over .pace-bar > i { background: var(--gasto); }
:root[data-theme="e"] .fx-bar i, :root[data-theme="e"] .goal-bar > i { background: var(--accent); }
:root[data-theme="e"] .goal-bar > span { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
:root[data-theme="e"] .kpi .v, :root[data-theme="e"] .nw-v, :root[data-theme="e"] .big-num, :root[data-theme="e"] .fc-v { font-family: "Inter Tight", "Inter Display", Inter, sans-serif; font-weight: 800; }
:root[data-theme="e"] .tag.ok { background: color-mix(in srgb, var(--ingreso) 12%, transparent); color: var(--ingreso); }
:root[data-theme="e"] .pk.first, :root[data-theme="e"] .ini-kpis .pk.first { border-color: #ecd9bb; background: radial-gradient(90% 120% at 100% 0%, rgba(245,165,36,.10), transparent 60%), var(--card); }
:root[data-theme="e"] .sp-a { fill: rgba(163,95,0,.12); }
:root[data-theme="e"] .sp-l { stroke: var(--accent); }
:root[data-theme="e"] .sp-p { fill: var(--accent); }
:root[data-theme="e"] .fijos-banner { background: var(--accent-soft); border-color: #ecd9bb; }
:root[data-theme="e"] .fb-go, :root[data-theme="e"] .addsub, :root[data-theme="e"] .search-open, :root[data-theme="e"] .linkbtn { color: var(--accent); }
:root[data-theme="e"] .fx-del { color: #5b6472; }
:root[data-theme="e"] .cal-d { background: color-mix(in srgb, #f5a524 calc(var(--l, 0) * 75%), var(--card)); }
:root[data-theme="e"] .tabs { background: #ffffff; border-top-color: var(--line); }
:root[data-theme="e"] .tabs button { color: #7a7f88; }
:root[data-theme="e"] .tabs button.active { color: var(--accent); }
:root[data-theme="e"] .toast { background: #1d1a15; }
:root[data-theme="e"] .toast button { color: #f5b14a; }
:root[data-theme="e"] dialog#modal { background: var(--card); }
:root[data-theme="e"] .saved-tick span { background: var(--accent); }
:root[data-theme="e"] code { background: #efece5; color: #3a3f47; }
@media (min-width: 900px) {
  :root[data-theme="e"] .tabs { background: #ffffff; border-right: 1px solid #e7d6be; }
  :root[data-theme="e"] .tabs::before { color: var(--ink); }
  :root[data-theme="e"] .tabs > button { color: #5b6472; }
  :root[data-theme="e"] .tabs > button:hover { background: #f6f3ee; }
  :root[data-theme="e"] .tabs > button.active { background: #f5eee4; color: var(--accent); box-shadow: inset -3px 0 0 #f5a524, inset 0 0 0 1px #f0dfc4; }
  :root[data-theme="e"] .tabs > button[data-tab="add"]:not(.active) { background: var(--accent); color: #fff; font-weight: 600; margin-bottom: 8px; box-shadow: 0 4px 14px rgba(163,95,0,.28); }
  :root[data-theme="e"] .tabs > button[data-tab="add"].active { margin-bottom: 8px; }
  :root[data-theme="e"] #side-toggle { background: #fff; border-color: #e7d6be; color: #5b6472; }
}
