/* ============================================
   FINANZAS â€” Estilos principales
   TipografÃ­a: Syne (display) + DM Sans (body)
   ============================================ */

:root {
  --bg:        #0d0f14;
  --bg-2:      #13161e;
  --bg-3:      #1a1e2a;
  --border:    rgba(255,255,255,0.07);
  --text:      #e8eaf0;
  --text-2:    #8b90a0;
  --text-3:    #555a6e;
  --accent:    #7c6af7;
  --accent-2:  #a89cf8;
  --income:    #22d4a2;
  --expense:   #f7666a;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 8px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
  --font-disp: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg:      #f0f0f5;
  --bg-2:    #ffffff;
  --bg-3:    #e8e8f0;
  --border:  rgba(0,0,0,0.08);
  --text:    #1a1a2e;
  --text-2:  #555570;
  --text-3:  #9999b0;
  --shadow:  0 4px 24px rgba(0,0,0,0.1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-3); border-radius: 10px; }

/* ====== UTILS ====== */
.hidden { display: none !important; }

/* ====== AUTH OVERLAY ====== */
.auth-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 2rem;
}

.brand-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-weight: 800; font-size: 1.2rem;
  color: white;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-disp);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-tabs {
  display: flex;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition);
}

.auth-tab.active {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-form { display: none; flex-direction: column; gap: 1rem; }
.auth-form.active { display: flex; }

/* ====== FORM ELEMENTS ====== */
.field-group {
  display: flex; flex-direction: column; gap: 6px;
}

.field-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-group .hint {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-3);
  font-weight: 400;
}

.field-group input,
.field-group select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  outline: none;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

.field-group input:focus,
.field-group select:focus {
  border-color: var(--accent);
}

.field-group input[type="color"] {
  padding: 4px;
  height: 42px;
  cursor: pointer;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ====== BUTTONS ====== */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-primary.full { width: 100%; }

.btn-icon {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.btn-icon:hover { color: var(--text); border-color: var(--accent); }

.auth-error {
  color: var(--expense);
  font-size: 0.82rem;
  min-height: 1em;
}

/* ====== APP LAYOUT ====== */
.app {
  display: flex;
  min-height: 100vh;
}

/* ====== SIDEBAR ====== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow: hidden;
}

/* Subtle gradient accent on sidebar */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #a89cf8, var(--income));
  z-index: 1;
}

.sidebar-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 1.25rem 0.5rem;
  position: relative; z-index: 2;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}

.sidebar .brand-icon {
  width: 34px; height: 34px;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--accent), #a89cf8);
  box-shadow: 0 4px 12px rgba(124,106,247,0.35);
}

.sidebar .brand-name {
  font-size: 1.15rem;
  background: linear-gradient(90deg, var(--text), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-close {
  display: none;
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  font-size: 1rem; padding: 4px;
}

/* Divider after brand */
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.75rem 1rem;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.75rem 0.85rem 0.35rem;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-icon {
  font-size: 0.95rem;
  width: 18px; text-align: center;
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text);
  background: var(--bg-3);
}

.nav-item.active {
  color: var(--accent-2);
  background: rgba(124,106,247,0.1);
  font-weight: 600;
}

/* Active left bar */
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

/* ====== SIDEBAR FOOTER - USER CARD ====== */
.sidebar-footer {
  margin: 0.5rem 0.75rem 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.sidebar-footer:hover {
  border-color: rgba(124,106,247,0.4);
  background: rgba(124,106,247,0.06);
}

.user-info {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), #a89cf8);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-weight: 800; font-size: 0.95rem;
  color: white; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(124,106,247,0.3);
  overflow: hidden;
}

.user-meta {
  display: flex; flex-direction: column; min-width: 0; gap: 1px;
}

.user-name {
  font-size: 0.83rem; font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.user-role {
  font-size: 0.68rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-menu-arrow {
  color: var(--text-3);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.user-menu-arrow.open {
  transform: rotate(-90deg);
  color: var(--accent-2);
}

/* ====== USER POPUP ====== */
.user-popup {
  position: absolute;
  bottom: 80px; left: 0.75rem; right: 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.25);
  overflow: hidden;
  z-index: 200;
  animation: popupIn 0.15s ease;
}

.user-popup-header {
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.user-popup-name {
  font-family: var(--font-disp);
  font-size: 0.9rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.01em;
}

.user-popup-email {
  font-size: 0.72rem; color: var(--text-3); margin-top: 1px;
}

.user-popup-item {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 0.6rem 1rem;
  background: none; border: none;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: all var(--transition);
}

.user-popup-item:hover { background: var(--bg-3); color: var(--text); }

.user-popup-item .pi-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: background var(--transition);
}

.user-popup-item:hover .pi-icon { background: rgba(124,106,247,0.15); }
.user-popup-item.danger:hover { color: var(--expense); }
.user-popup-item.danger:hover .pi-icon { background: rgba(247,102,106,0.12); }

.user-popup-divider {
  height: 1px; background: var(--border); margin: 3px 0;
}

.btn-logout { display: none; } /* handled by popup now */

/* ====== MAIN ====== */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ====== TOPBAR ====== */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  font-size: 1.2rem;
}

.topbar-month {
  display: flex; align-items: center; gap: 8px;
}

.month-label {
  font-family: var(--font-disp);
  font-weight: 700; font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text);
  min-width: 130px; text-align: center;
}

.month-nav {
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  font-size: 1.4rem; line-height: 1;
  padding: 2px 6px;
  transition: color var(--transition);
}

.month-nav:hover { color: var(--accent); }

.topbar-actions {
  display: flex; align-items: center; gap: 8px;
}

.btn-add {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ====== VIEW CONTAINER ====== */
.view-container {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.view { display: none; }
.view.active { display: block; }

/* ====== KPI ROW ====== */
.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
}

.kpi::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
}

.kpi-balance::before { background: var(--accent); }
.kpi-income::before  { background: var(--income); }
.kpi-expense::before { background: var(--expense); }

.kpi-label {
  font-size: 0.75rem; font-weight: 500;
  color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em;
}

.kpi-value {
  font-family: var(--font-disp);
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.kpi-balance .kpi-value.positive { color: var(--income); }
.kpi-balance .kpi-value.negative { color: var(--expense); }

/* ====== CARDS ====== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card-title {
  font-family: var(--font-disp);
  font-size: 0.85rem; font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.card:has(#income-donut) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ====== DONUT CHART ====== */
.donut-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
}

.donut-center {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
}

.donut-total {
  font-family: var(--font-disp);
  font-size: 1.1rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.02em;
}

.donut-sub {
  font-size: 0.65rem; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.donut-wrap canvas {
  max-width: 350px !important;
  max-height: 350px !important;
}

/* ====== RANKING ====== */
.ranking-list { display: flex; flex-direction: column; gap: 8px; }

.ranking-item {
  display: flex; align-items: center; gap: 8px;
}

.ranking-pos {
  font-family: var(--font-disp);
  font-size: 0.7rem; font-weight: 800;
  color: var(--text-3);
  width: 16px; text-align: right; flex-shrink: 0;
}

.ranking-icon {
  font-size: 1rem; flex-shrink: 0;
}

.ranking-info { flex: 1; min-width: 0; }

.ranking-name {
  font-size: 0.82rem; font-weight: 500;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ranking-bar-wrap {
  height: 4px; background: var(--bg-3); border-radius: 2px; margin-top: 4px;
}

.ranking-bar {
  height: 100%; border-radius: 2px;
  transition: width 0.6s ease;
}

.ranking-amount {
  font-family: var(--font-disp);
  font-size: 0.8rem; font-weight: 700;
  color: var(--text); white-space: nowrap; flex-shrink: 0;
}

/* ====== COMPARE ====== */
.compare-list { display: flex; flex-direction: column; gap: 10px; }

.compare-item {
  display: flex; align-items: center; gap: 8px;
}

.compare-icon { font-size: 1.1rem; flex-shrink: 0; }

.compare-info { flex: 1; min-width: 0; }

.compare-name {
  font-size: 0.82rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.compare-amounts {
  font-size: 0.72rem; color: var(--text-3);
}

.compare-badge {
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
  padding: 2px 7px; border-radius: 20px;
}

.badge-up   { background: rgba(247,102,106,0.15); color: var(--expense); }
.badge-down { background: rgba(34,212,162,0.15);  color: var(--income); }
.badge-new  { background: rgba(124,106,247,0.15); color: var(--accent-2); }

/* ====== RECENT TRANSACTIONS ====== */
.recent-list { display: flex; flex-direction: column; gap: 6px; }

.tx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.tx-item:hover { background: var(--bg-3); }

.tx-cat-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
  position: relative;
}

.tx-type-badge {
  position: absolute;
  bottom: -4px; right: -4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.55rem; font-weight: 700;
  color: #fff;
  border: 1.5px solid var(--card);
  line-height: 1;
}

.tx-info { flex: 1; min-width: 0; }

.tx-desc {
  font-size: 0.85rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tx-meta {
  font-size: 0.72rem; color: var(--text-3);
}

.tx-amount {
  font-family: var(--font-disp);
  font-size: 0.9rem; font-weight: 700; flex-shrink: 0;
}

.tx-amount.income  { color: var(--income); }
.tx-amount.expense { color: var(--expense); }

.tx-delete {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 0.8rem; padding: 4px;
  border-radius: 4px;
  transition: all var(--transition);
  flex-shrink: 0;
  opacity: 0;
}

.tx-item:hover .tx-delete { opacity: 1; }
.tx-delete:hover { color: var(--expense); background: rgba(247,102,106,0.1); }

/* ====== TRANSACTIONS VIEW ====== */
.tx-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: 1rem;
}

.filter-group {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--transition);
}

.filter-select:focus { border-color: var(--accent); }

.tx-list {
  display: flex; flex-direction: column; gap: 6px;
}

/* ====== ANALYTICS ====== */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

.span-2 { grid-column: span 2; }

.cat-breakdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.cat-breakdown-item:last-child { border-bottom: none; }

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  padding: 1rem;
}

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.75rem;
  width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-sm { max-width: 360px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-family: var(--font-disp);
  font-size: 1.1rem; font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-close {
  background: none; border: none;
  color: var(--text-2); cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--bg-3); color: var(--text); }

/* TYPE TOGGLE */
.type-toggle {
  display: flex;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.25rem;
}

.type-btn {
  flex: 1; padding: 8px;
  border: none; background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border-radius: 6px;
  transition: all var(--transition);
}

.type-btn.active[data-type="expense"] {
  background: rgba(247,102,106,0.2); color: var(--expense);
}

.type-btn.active[data-type="income"] {
  background: rgba(34,212,162,0.2); color: var(--income);
}

.tx-form { display: flex; flex-direction: column; gap: 1rem; }
#tx-form { display: flex; flex-direction: column; gap: 1rem; }

.cat-add-btn {
  font-size: 0.75rem; color: var(--accent-2);
  background: none; border: none;
  cursor: pointer; text-decoration: underline;
  align-self: flex-end;
  font-family: var(--font-body);
}

/* ====== TOAST ====== */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 999;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  max-width: 300px;
}

.toast.success { border-left: 3px solid var(--income); }
.toast.error   { border-left: 3px solid var(--expense); }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ====== EMPTY STATE ====== */
.empty-state {
  color: var(--text-3);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 1rem;
  font-style: italic;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close { display: block; }

  .main { margin-left: 0; }

  .menu-toggle { display: block; }

  .kpi-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .span-2 { grid-column: span 1; }

  .view-container { padding: 1rem; }

  .topbar { padding: 0 1rem; }

  .month-label { min-width: 100px; font-size: 0.9rem; }

  .btn-add { padding: 0.45rem 0.8rem; font-size: 0.8rem; }

  .kpi-value { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }

  .topbar-actions .theme-toggle { display: none; }
}

/* ====== HOUSEHOLD ====== */
.household-panel {
  max-width: 600px;
}

.household-empty {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
}

.household-empty h3 {
  font-family: var(--font-disp);
  font-size: 1.1rem; font-weight: 800;
  margin-bottom: 0.5rem;
}

.household-empty p {
  color: var(--text-2); font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.household-actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
}

.btn-secondary {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent-2); }

.btn-danger {
  background: rgba(247,102,106,0.1);
  border: 1px solid rgba(247,102,106,0.3);
  color: var(--expense);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover { background: rgba(247,102,106,0.2); }

.household-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.household-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.household-title {
  font-family: var(--font-disp);
  font-size: 1.2rem; font-weight: 800;
  letter-spacing: -0.02em;
}

.household-meta {
  font-size: 0.78rem; color: var(--text-3); margin-top: 2px;
}

.invite-box {
  background: var(--bg-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.5rem;
  margin: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

.invite-label {
  font-size: 0.72rem; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.invite-code {
  font-family: var(--font-disp);
  font-size: 1.4rem; font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--accent-2);
}

.btn-copy {
  background: var(--accent);
  color: white; border: none;
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-size: 0.8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.btn-copy:hover { background: var(--accent-2); }

.members-section {
  padding: 0 1.5rem 1.5rem;
}

.members-section h4 {
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 0.75rem; margin-top: 1rem;
}

.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.member-row:last-child { border-bottom: none; }

.member-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-size: 0.8rem; font-weight: 700;
  color: var(--text-2); flex-shrink: 0;
}

.member-info { flex: 1; min-width: 0; }

.member-name {
  font-size: 0.85rem; font-weight: 500; color: var(--text);
}

.member-email {
  font-size: 0.72rem; color: var(--text-3);
}

.member-badge {
  font-size: 0.68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(124,106,247,0.15);
  color: var(--accent-2);
}

.household-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ====== MEMBERS CONTRIBUTION CARD ====== */
.members-list { display: flex; flex-direction: column; gap: 10px; }

.member-contrib {
  display: flex; align-items: center; gap: 10px;
}

.member-contrib-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-2); flex-shrink: 0;
}

.member-contrib-info { flex: 1; min-width: 0; }

.member-contrib-name {
  font-size: 0.82rem; font-weight: 500; color: var(--text);
}

.member-contrib-amounts {
  font-size: 0.72rem; color: var(--text-3);
}

/* Join/create modal inputs */
.join-input-wrap {
  display: flex; gap: 8px; margin-top: 0.5rem;
}

.join-input-wrap input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  color: var(--text);
  font-family: var(--font-disp);
  font-size: 1.1rem; font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  outline: none;
}

.join-input-wrap input:focus { border-color: var(--accent); }

/* ====== SCAN RECEIPT ====== */
.scan-receipt-wrap {
  display: flex; flex-direction: column; gap: 8px;
}

.btn-scan {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-3);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn-scan:hover {
  border-color: var(--accent);
  color: var(--accent-2);
  background: rgba(124,106,247,0.06);
}

.btn-scan.loading {
  opacity: 0.7; pointer-events: none;
}

.scan-icon { font-size: 1.1rem; }

.scan-status {
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
}

.scan-status.success {
  background: rgba(34,212,162,0.1);
  border: 1px solid rgba(34,212,162,0.25);
  color: var(--income);
}

.scan-status.error {
  background: rgba(247,102,106,0.1);
  border: 1px solid rgba(247,102,106,0.25);
  color: var(--expense);
}

.scan-status.warning {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  color: #f59e0b;
}

.scan-preview {
  width: 100%; max-height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 4px;
}

/* ====== PANTRY ====== */
.pantry-toolbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}

.pantry-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
}

.ptab {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 20px;
  padding: 5px 14px;
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.ptab:hover { border-color: var(--accent); color: var(--text); }
.ptab.active { background: var(--accent); color: white; border-color: var(--accent); }

.pantry-actions {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
}

.alert-badge {
  background: var(--expense);
  color: white;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.75rem; font-weight: 700;
  cursor: default;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* PANTRY GRID */
.pantry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.pantry-item-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  position: relative;
  transition: all var(--transition);
  cursor: pointer;
}

.pantry-item-card:hover { border-color: var(--accent); transform: translateY(-1px); }

.pantry-item-card.alert {
  border-color: rgba(247,102,106,0.4);
  background: rgba(247,102,106,0.04);
}

.pantry-item-card.warning {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.04);
}

.pi-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pi-name {
  font-family: var(--font-disp);
  font-size: 0.9rem; font-weight: 700;
  color: var(--text); line-height: 1.2;
}

.pi-cat-badge {
  font-size: 0.65rem; font-weight: 600;
  padding: 2px 7px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
  margin-left: 6px;
}

.cat-perecible    { background: rgba(249,115,22,0.15);  color: #f97316; }
.cat-congelado    { background: rgba(59,130,246,0.15);  color: #3b82f6; }
.cat-no_perecible { background: rgba(34,197,94,0.15);   color: #22c55e; }
.cat-limpieza     { background: rgba(139,92,246,0.15);  color: #8b5cf6; }
.cat-higiene      { background: rgba(236,72,153,0.15);  color: #ec4899; }
.cat-otro         { background: rgba(148,163,184,0.15); color: #94a3b8; }

.pi-qty-display {
  display: flex; align-items: baseline; gap: 4px;
  margin: 0.5rem 0;
}

.pi-qty-num {
  font-family: var(--font-disp);
  font-size: 1.6rem; font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.pi-qty-unit {
  font-size: 0.75rem; color: var(--text-3);
}

.pi-progress {
  height: 5px; background: var(--bg-3); border-radius: 3px; margin-bottom: 0.75rem;
}

.pi-progress-bar {
  height: 100%; border-radius: 3px;
  transition: width 0.4s ease;
}

.pi-actions {
  display: flex; gap: 6px;
}

.pi-btn {
  flex: 1; padding: 5px;
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2); border-radius: 6px;
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}

.pi-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.pi-btn.use:hover { background: var(--expense); border-color: var(--expense); }

.pi-delete {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 0.75rem; padding: 2px 4px;
  opacity: 0; transition: opacity var(--transition);
}

.pantry-item-card:hover .pi-delete { opacity: 1; }
.pi-delete:hover { color: var(--expense); }

.pi-alert-tag {
  font-size: 0.68rem; font-weight: 700;
  color: var(--expense); margin-top: 4px;
}

/* SHOPPING LIST */
.shopping-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 8px;
}

.shopping-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: all var(--transition);
}

.shopping-item.checked {
  opacity: 0.5;
}

.shopping-item.checked .si-name { text-decoration: line-through; }

.si-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
  background: transparent;
}

.si-check.checked { background: var(--income); border-color: var(--income); }
.si-check.checked::after { content: 'âœ“'; font-size: 0.75rem; color: white; font-weight: 700; }

.si-name { flex: 1; font-size: 0.875rem; font-weight: 500; color: var(--text); }
.si-qty  { font-size: 0.8rem; color: var(--text-3); white-space: nowrap; }

.si-delete {
  background: none; border: none;
  color: var(--text-3); cursor: pointer; font-size: 0.8rem;
  padding: 2px 6px; border-radius: 4px;
  transition: all var(--transition);
}

.si-delete:hover { color: var(--expense); background: rgba(247,102,106,0.1); }

/* Receipt items modal */
.receipt-item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}

.receipt-item-row:last-child { border-bottom: none; }

.ri-check {
  width: 18px; height: 18px;
  accent-color: var(--accent); cursor: pointer; flex-shrink: 0;
}

.ri-info { flex: 1; }

.ri-name { font-size: 0.85rem; font-weight: 500; color: var(--text); }

.ri-meta { font-size: 0.72rem; color: var(--text-3); }

.ri-qty-input {
  width: 60px;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px;
  color: var(--text); font-size: 0.82rem; text-align: center;
  outline: none;
}

/* ====== PROFILE ====== */
.profile-wrap {
  max-width: 560px;
  display: flex; flex-direction: column; gap: 1rem;
}

.profile-card {
  padding: 1.5rem;
}

.profile-avatar-section {
  display: flex; align-items: center; gap: 1.25rem;
}

.profile-avatar-img {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-size: 1.6rem; font-weight: 800;
  color: white;
  overflow: hidden;
}

.profile-avatar-img img {
  width: 100%; height: 100%; object-fit: cover;
}

.profile-avatar-edit {
  position: absolute; bottom: 2px; right: 2px;
  width: 22px; height: 22px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.65rem; font-weight: 700;
  cursor: pointer;
  border: 2px solid var(--bg-2);
  transition: background var(--transition);
  line-height: 1;
  text-align: center;
}
.profile-avatar-edit:hover { background: var(--accent-2); }

.profile-avatar-wrap {
  position: relative;
  width: 72px; height: 72px;
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-disp);
  font-size: 1.2rem; font-weight: 800;
  letter-spacing: -0.02em;
}

.profile-header-info {
  display: flex; flex-direction: column; gap: 2px;
}

.profile-email-display {
  font-size: 0.82rem; color: var(--text-2); margin-top: 2px;
}

.profile-phone-display {
  font-size: 0.82rem; color: var(--income);
  display: flex; align-items: center; gap: 4px;
  margin-top: 2px;
}

.profile-phone-display::before {
  content: "ðŸ“±";
  font-size: 0.75rem;
}

.profile-success {
  color: var(--income);
  font-size: 0.82rem; min-height: 1em;
}

/* WhatsApp contact selector */
.wa-contact-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 6px;
}

.wa-contact-item:hover { background: rgba(34,212,162,0.1); }

.wa-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp);
  font-size: 0.85rem; font-weight: 700;
  color: white; flex-shrink: 0;
}

.wa-info { flex: 1; }
.wa-name { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.wa-phone { font-size: 0.72rem; color: var(--text-3); }
.wa-send-icon { color: var(--income); font-size: 1.1rem; }

@keyframes popupIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Profile modal avatar centered */
.profile-avatar-center {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 0.5rem;
}

/* â”€â”€ CATEGORIES VIEW â”€â”€ */
.cat-group { margin-bottom: 2rem; }

.cat-group-label {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cat-group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}

.cat-card {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
}

.cat-card:hover { border-color: var(--accent); }

.cat-card-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.cat-card-info { flex: 1; min-width: 0; }

.cat-card-name {
  font-size: 0.875rem; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cat-card-meta {
  font-size: 0.72rem; color: var(--text-3);
  margin-top: 1px;
}

.cat-card-edit {
  background: transparent; border: none;
  cursor: pointer; font-size: 0.9rem;
  padding: 4px; border-radius: 6px;
  opacity: 0.4; transition: opacity 0.2s, background 0.2s;
  flex-shrink: 0;
}

.cat-card:hover .cat-card-edit { opacity: 1; }
.cat-card-edit:hover { background: var(--border); }

/* ── Bank selector ── */
.bank-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.bank-option {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.bank-option:has(input:checked) {
  border-color: var(--accent, #6366f1);
  background: rgba(99,102,241,0.08);
}
.bank-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent, #7c6af7);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}
.bank-option-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.bank-option-label small {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--text-3);
}

/* ── Comisión bancaria ── */
.bank-fee-section {
  background: var(--surface-2, rgba(255,255,255,0.04));
  border: 1.5px solid rgba(239,68,68,0.25);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
}
.bank-fee-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.75rem;
}
#bank-fee-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--text-3);
  border-radius: 20px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent, #6366f1); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ── Scope toggle (personal/hogar) ── */
.scope-toggle {
  display: flex;
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 0.5rem;
}
.scope-btn {
  flex: 1; padding: 7px;
  border: none; background: transparent;
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 0.85rem; font-weight: 600;
  cursor: pointer; border-radius: 6px;
  transition: all var(--transition);
}
.scope-btn.active {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
/* ── Export ── */
.export-fmt-btn, .export-period-btn {
  flex: 1;
  padding: 0.55rem 0.75rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-disp);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--transition);
}
.export-fmt-btn:hover, .export-period-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}
.export-fmt-btn.active, .export-period-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(124,106,247,0.35);
}
#export-scope {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

/* ====== FONDO COMÚN ====== */
.fund-balance-display {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.fund-balance-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(34,212,162,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.fund-balance-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fund-balance-label {
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.fund-balance-amount {
  font-family: var(--font-disp);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--income);
  line-height: 1;
}

.fund-actions {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.fund-movements {
  padding: 1rem 1.5rem;
}

.fund-movements-title {
  font-size: 0.72rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.fund-movement-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  flex-shrink: 0;
}

.fund-movement-icon.in  { background: rgba(34,212,162,0.15); color: var(--income); }
.fund-movement-icon.out { background: rgba(247,102,106,0.15); color: var(--expense); }

/* ====== VER TODAS TRANSACCIONES ====== */
.btn-ver-todas {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent-2);
  border-radius: 20px;
  padding: 4px 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.btn-ver-todas:hover {
  background: var(--accent);
  color: white;
}

.tx-expanded {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.tx-expanded-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}

.tx-expanded .tx-list {
  max-height: 400px;
  overflow-y: auto;
}