:root {
  /* Paleta solicitada: Verde menta pálido · Azul marino · Coral */
  --mint-canvas: #EFF7F3;
  --mint-soft: #E1F0E8;
  --mint-tint: #D3E9DE;
  --mint-border: #C5DED1;
  --mint-positive: #12785C;
  --mint-positive-soft: #DFF3EB;

  --navy: #0F2537;
  --navy-2: #1B3B55;
  --navy-3: #28506F;
  --navy-text: #0F2537;
  --navy-muted: #4A6478;
  --navy-subtle: #6E8596;

  --coral: #F06454;
  --coral-dark: #D94D3D;
  --coral-soft: #FDECE9;
  --coral-border: #F8CBC4;

  --surface: #FFFFFF;
  --line: rgba(15, 37, 55, 0.09);
  --line-strong: rgba(15, 37, 55, 0.16);
  --shadow-sm: 0 2px 10px rgba(15, 37, 55, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 37, 55, 0.09);
  --shadow-lg: 0 20px 48px rgba(15, 37, 55, 0.18);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;

  --topbar-h: 56px;
  --bottombar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--mint-canvas);
  color: var(--navy-text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.mono, .num {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   AUTH SCREEN (Login / Registro)
   ========================================================================== */
.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(640px 360px at 10% 0%, rgba(197, 222, 209, 0.7), transparent 60%),
    radial-gradient(520px 340px at 95% 100%, rgba(240, 100, 84, 0.12), transparent 58%),
    var(--mint-canvas);
}

.auth-shell {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

@media (min-width: 820px) {
  .auth-shell {
    grid-template-columns: 1.05fr 1fr;
  }
}

.auth-hero {
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #FFFFFF;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  display: block;
}
.auth-brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.auth-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.55rem, 2.8vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.auth-hero p {
  margin: 0;
  color: rgba(239, 247, 243, 0.8);
  font-size: 0.94rem;
  line-height: 1.55;
}
.auth-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 0.86rem;
  color: rgba(239, 247, 243, 0.9);
}
.auth-features li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-feat-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(207, 236, 224, 0.16);
  color: #CFECE0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.auth-feat-mark svg { width: 13px; height: 13px; }
.auth-ni-time {
  font-size: 0.78rem;
  color: rgba(207, 236, 224, 0.78);
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-panel {
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.seg-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--mint-soft);
}
.seg-control.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.seg-btn {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--navy-muted);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.seg-btn.is-active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.seg-btn.is-active.is-coral {
  background: var(--coral);
  color: #FFFFFF;
}
.seg-btn.is-active.is-mint {
  background: var(--mint-positive);
  color: #FFFFFF;
}
.seg-btn.is-active.is-navy {
  background: var(--navy);
  color: #FFFFFF;
}

.form-stack {
  display: grid;
  gap: 14px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border-radius: 12px;
  border: 1.5px solid var(--mint-border);
  background: #FAFDFB;
  color: var(--navy);
  font-size: 0.94rem;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.field textarea {
  min-height: 76px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(15, 37, 55, 0.08);
}
.field-hint {
  font-size: 0.76rem;
  color: var(--navy-muted);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 440px) {
  .field-row.stack-xs { grid-template-columns: 1fr; }
}

.alert-box {
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
}
.alert-box.is-error {
  background: var(--coral-soft);
  border: 1px solid var(--coral-border);
  color: #9E271A;
}
.alert-box.is-ok {
  background: var(--mint-positive-soft);
  border: 1px solid var(--mint-border);
  color: #0D5944;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.14s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-coral {
  background: var(--coral);
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(240, 100, 84, 0.28);
}
.btn-coral:hover { background: var(--coral-dark); }
.btn-navy {
  background: var(--navy);
  color: #FFFFFF;
}
.btn-navy:hover { background: var(--navy-2); }
.btn-soft {
  background: var(--mint-soft);
  color: var(--navy);
  border-color: var(--mint-border);
}
.btn-soft:hover { background: var(--mint-tint); }
.btn-ghost {
  background: transparent;
  color: var(--navy-muted);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--mint-soft); color: var(--navy); }
.btn-danger {
  background: var(--coral-soft);
  color: #B42B1D;
  border-color: var(--coral-border);
}
.btn-danger:hover { background: #FBDAD5; }
.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 9px;
}
.btn-block { width: 100%; }

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.icon-btn:hover {
  background: var(--mint-soft);
  border-color: var(--mint-border);
}
.icon-btn svg { width: 20px; height: 20px; }

/* ==========================================================================
   APP SHELL — TOP BAR (Mobile + Desktop) & BOTTOM NATIVE TAB BAR
   ========================================================================== */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: rgba(239, 247, 243, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--navy);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-link img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
}

.desktop-nav {
  display: none;
  align-items: center;
  gap: 6px;
}
.desktop-nav-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--navy-muted);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s ease, background 0.15s ease;
}
.desktop-nav-btn:hover {
  color: var(--navy);
  background: var(--mint-soft);
}
.desktop-nav-btn.is-active {
  color: var(--navy);
  background: var(--mint-tint);
  font-weight: 700;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.desktop-cta { display: none; }

.avatar-btn {
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px 0 5px;
  border-radius: 999px;
  border: 1px solid var(--mint-border);
  background: var(--surface);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  font-weight: 700;
}
.avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--navy);
  color: #CFECE0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}
.avatar-name {
  display: none;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.install-chip-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--coral-border);
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.install-chip-btn svg { width: 15px; height: 15px; }

/* Main Content Area */
.main-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px) + 26px);
}

/* Native Bottom Navigation Bar (Mobile) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(var(--bottombar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  box-shadow: 0 -6px 24px rgba(15, 37, 55, 0.06);
}

.bnav-item {
  height: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--navy-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  transition: color 0.15s ease;
}
.bnav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.9;
}
.bnav-item span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.bnav-item.is-active {
  color: var(--navy);
}
.bnav-item.is-active svg {
  stroke-width: 2.3;
  color: var(--coral);
}
.bnav-item.is-active span {
  font-weight: 800;
}

.bnav-fab-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bnav-fab {
  width: 52px;
  height: 52px;
  margin-top: -18px;
  border-radius: 17px;
  border: 3px solid var(--mint-canvas);
  background: linear-gradient(145deg, var(--coral) 0%, var(--coral-dark) 100%);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(240, 100, 84, 0.4);
  transition: transform 0.14s ease;
}
.bnav-fab:active { transform: scale(0.93); }
.bnav-fab svg { width: 25px; height: 25px; stroke-width: 2.5; }

@media (min-width: 960px) {
  .topbar {
    --topbar-h: 64px;
    padding: 0 28px;
  }
  .desktop-nav { display: flex; }
  .desktop-cta { display: inline-flex; }
  .avatar-name { display: inline; }
  .bottom-nav { display: none; }
  .main-content {
    padding: 28px 28px 48px;
  }
}

/* ==========================================================================
   OFFLINE BANNER
   ========================================================================== */
.offline-bar {
  background: var(--navy);
  color: #CFECE0;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
}

/* ==========================================================================
   VIEWS & LAYOUT BLOCKS
   ========================================================================== */
.view {
  display: grid;
  gap: 18px;
}

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.view-head h1,
.view-head h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--navy);
}
.view-sub {
  margin: 3px 0 0;
  font-size: 0.84rem;
  color: var(--navy-muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.card-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.015em;
}
.card-link {
  border: 0;
  background: transparent;
  color: var(--coral-dark);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 8px;
}
.card-link:hover { background: var(--coral-soft); }

/* ==========================================================================
   HOME / DASHBOARD
   ========================================================================== */
.dash-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 960px) {
  .dash-grid {
    grid-template-columns: 1.25fr 1fr;
    align-items: start;
  }
}

.hero-balance {
  background: linear-gradient(145deg, var(--navy) 0%, #17344D 68%, #1E4463 100%);
  color: #FFFFFF;
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 18px;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.hero-greeting {
  font-size: 0.82rem;
  color: rgba(207, 236, 224, 0.86);
  font-weight: 600;
}
.hero-ni-clock {
  font-size: 0.76rem;
  color: rgba(207, 236, 224, 0.68);
  margin-top: 2px;
}

.curr-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}
.curr-toggle button {
  min-height: 32px;
  min-width: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  font-weight: 700;
}
.curr-toggle button.is-active {
  background: #CFECE0;
  color: var(--navy);
}

.hero-amount-label {
  font-size: 0.78rem;
  color: rgba(207, 236, 224, 0.78);
  font-weight: 600;
}
.hero-amount {
  font-family: var(--font-ui);
  font-size: clamp(1.9rem, 5vw, 2.55rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 4px;
}

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.hero-split-box {
  display: grid;
  gap: 2px;
}
.hero-split-box small {
  font-size: 0.74rem;
  color: rgba(207, 236, 224, 0.72);
}
.hero-split-box strong {
  font-size: 1.02rem;
  font-weight: 700;
  color: #FFFFFF;
}

.hero-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.76rem;
  color: rgba(207, 236, 224, 0.78);
}
.hero-rate-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #CFECE0;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
}
.hero-rate-btn:hover { background: rgba(255, 255, 255, 0.18); }

/* Quick actions row */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.qa-btn {
  min-height: 68px;
  padding: 10px 6px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, border-color 0.15s ease;
}
.qa-btn:hover { border-color: var(--mint-border); transform: translateY(-1px); }
.qa-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qa-ico svg { width: 18px; height: 18px; }
.qa-ico.is-coral { background: var(--coral-soft); color: var(--coral-dark); }
.qa-ico.is-mint { background: var(--mint-positive-soft); color: var(--mint-positive); }
.qa-ico.is-navy { background: rgba(15, 37, 55, 0.08); color: var(--navy); }
.qa-btn span {
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

/* KPI Pair */
.kpi-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 6px;
}
.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy-muted);
}
.kpi-val {
  font-size: 1.24rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.kpi-val.is-in { color: var(--mint-positive); }
.kpi-val.is-out { color: var(--coral-dark); }
.kpi-sub {
  font-size: 0.75rem;
  color: var(--navy-subtle);
}

/* Horizontal accounts strip on home */
.acc-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.acc-strip::-webkit-scrollbar { display: none; }

.acc-mini {
  min-width: 196px;
  flex: 0 0 auto;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.14s ease;
}
.acc-mini:hover {
  border-color: var(--navy-2);
  transform: translateY(-1px);
}
.acc-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--navy-muted);
  font-weight: 600;
}
.acc-mini-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-mini-bal {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}

/* ==========================================================================
   TRANSACTION ROWS (Tap-friendly native list)
   ========================================================================== */
.tx-group-head {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy-muted);
  padding: 10px 4px 6px;
}
.tx-list {
  display: grid;
}
.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 10px 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 0.13s ease;
}
.tx-row:last-child { border-bottom: 0; }
.tx-row:hover { background: rgba(225, 240, 232, 0.45); border-radius: 12px; }

.tx-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tx-ico svg { width: 18px; height: 18px; }
.tx-ico.is-gasto { background: var(--coral-soft); color: var(--coral-dark); }
.tx-ico.is-ingreso { background: var(--mint-positive-soft); color: var(--mint-positive); }
.tx-ico.is-transferencia { background: rgba(15, 37, 55, 0.09); color: var(--navy); }

.tx-body {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
}
.tx-desc {
  font-size: 0.91rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-meta {
  font-size: 0.76rem;
  color: var(--navy-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-amt-col {
  text-align: right;
  flex-shrink: 0;
  display: grid;
  gap: 2px;
}
.tx-amt {
  font-size: 0.94rem;
  font-weight: 800;
  white-space: nowrap;
}
.tx-amt.is-gasto { color: var(--coral-dark); }
.tx-amt.is-ingreso { color: var(--mint-positive); }
.tx-amt.is-transferencia { color: var(--navy); }
.tx-amt-sub {
  font-size: 0.72rem;
  color: var(--navy-subtle);
  white-space: nowrap;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--navy-muted);
  font-size: 0.88rem;
  display: grid;
  gap: 8px;
  justify-items: center;
}

/* ==========================================================================
   FILTERS BAR (Movimientos & Reportes)
   ========================================================================== */
.filter-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.filter-grid input,
.filter-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--mint-border);
  background: #FAFDFB;
  color: var(--navy);
  font-size: 0.83rem;
  font-weight: 600;
}

.preset-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.preset-row::-webkit-scrollbar { display: none; }
.preset-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--mint-border);
  background: var(--mint-canvas);
  color: var(--navy-muted);
  font-size: 0.79rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.preset-btn.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #FFFFFF;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 520px) {
  .summary-strip { grid-template-columns: 1fr; }
}
.sum-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 3px;
}
.sum-box small {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy-muted);
}
.sum-box strong {
  font-size: 1.06rem;
  font-weight: 800;
}
.sum-box .sum-sub {
  font-size: 0.73rem;
  color: var(--navy-subtle);
}

/* ==========================================================================
   ACCOUNTS GRID & CATEGORIES MANAGER
   ========================================================================== */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}
.account-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 14px;
}
.account-card.is-archived {
  opacity: 0.65;
  background: #F6FBF8;
}
.acc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.acc-swatch {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}
.acc-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}
.acc-title-wrap strong {
  display: block;
  font-size: 0.98rem;
  color: var(--navy);
}
.acc-title-wrap small {
  display: block;
  font-size: 0.77rem;
  color: var(--navy-muted);
  margin-top: 2px;
}
.acc-balance-big {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--navy);
}
.acc-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* Categories & Subcategories */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.cat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.cat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cat-name-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.cat-color-sq {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}
.cat-name-group strong {
  font-size: 0.95rem;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.subcat-list {
  display: grid;
  gap: 6px;
}
.subcat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--mint-canvas);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy);
}
.subcat-actions {
  display: inline-flex;
  gap: 4px;
}
.mini-link-btn {
  border: 0;
  background: transparent;
  color: var(--navy-muted);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 6px;
}
.mini-link-btn:hover { background: var(--mint-tint); color: var(--navy); }
.mini-link-btn.is-del:hover { background: var(--coral-soft); color: var(--coral-dark); }

/* ==========================================================================
   REPORTS & CHARTS
   ========================================================================== */
.report-layout {
  display: grid;
  gap: 18px;
}
@media (min-width: 960px) {
  .report-layout {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
  }
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy-muted);
  margin-bottom: 10px;
}
.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
}

.breakdown-list {
  display: grid;
  gap: 14px;
}
.bk-item {
  display: grid;
  gap: 7px;
}
.bk-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.bk-name-btn {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
}
.bk-name-btn:hover { color: var(--coral-dark); text-decoration: underline; }
.bk-val {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
}
.bk-meta {
  font-size: 0.75rem;
  color: var(--navy-subtle);
}
.bk-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--mint-soft);
  overflow: hidden;
}
.bk-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.bk-subs {
  margin-left: 14px;
  padding-left: 12px;
  border-left: 1px solid var(--mint-border);
  display: grid;
  gap: 6px;
}
.bk-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--navy-muted);
}

/* ==========================================================================
   BOTTOM SHEETS (Mobile) & DIALOG MODALS (Desktop)
   ========================================================================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 37, 55, 0.48);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 720px) {
  .sheet-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.sheet {
  width: 100%;
  max-width: 540px;
  max-height: 92dvh;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheetUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 720px) {
  .sheet {
    border-radius: 22px;
  }
}
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}

.sheet-handle {
  width: 40px;
  height: 5px;
  border-radius: 999px;
  background: var(--mint-border);
  margin: 10px auto 2px;
}
@media (min-width: 720px) {
  .sheet-handle { display: none; }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
}
.sheet-body {
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  display: grid;
  gap: 14px;
}
.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}

/* Toast notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottombar-h) + 18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 120;
  background: var(--navy);
  color: #FFFFFF;
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 32px);
  text-align: center;
}
@media (min-width: 960px) {
  .toast { bottom: 24px; }
}

/* Color swatch picker */
.swatch-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch-opt {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 2px solid transparent;
  padding: 0;
}
.swatch-opt.is-active {
  border-color: var(--navy);
  transform: scale(1.1);
}

/* Print Styles for Reports */
@media print {
  .topbar, .bottom-nav, .filter-card, .btn, .card-link, .toast, .sheet-backdrop {
    display: none !important;
  }
  body { background: #FFFFFF; }
  .main-content { padding: 0; max-width: 100%; }
  .card { box-shadow: none; border: 1px solid #CBD5E1; break-inside: avoid; }
}
