/* ========================================
   FINZA — Design System: Liquid Glass
   ======================================== */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  color-scheme: dark;
  
  /* iOS Safe Areas */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  /* Backgrounds */
  --bg-primary: #1D212D;
  --bg-secondary: #252A38;
  --bg-card: rgba(42, 47, 64, 0.55);
  --bg-card-hover: rgba(42, 47, 64, 0.75);
  --bg-glass: rgba(42, 47, 64, 0.35);
  --bg-modal: rgba(29, 33, 45, 0.94);
  --bg-input: rgba(42, 47, 64, 0.6);
  --bg-sidebar: rgba(29, 33, 45, 0.85);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #F6F8F9;
  --text-muted: #94A2B8;
  --text-disabled: #5a6478;

  /* Accents */
  --accent-income: #49DD7F;
  --accent-income-bg: rgba(73, 221, 127, 0.12);
  --accent-expense: #F77070;
  --accent-expense-bg: rgba(247, 112, 112, 0.12);
  --accent-savings: #60A5F9;
  --accent-savings-bg: rgba(96, 165, 249, 0.12);
  --accent-purple: #A78BFA;
  --accent-purple-bg: rgba(167, 139, 250, 0.12);
  --accent-amber: #FBBF24;
  --accent-amber-bg: rgba(251, 191, 36, 0.12);

  /* Borders */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-active: rgba(255, 255, 255, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow-green: 0 0 20px rgba(73, 221, 127, 0.15);
  --shadow-glow-red: 0 0 20px rgba(247, 112, 112, 0.15);
  --shadow-glow-blue: 0 0 20px rgba(96, 165, 249, 0.15);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Glass */
  --blur-glass: blur(24px);
  --blur-modal: blur(40px);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: manipulation;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  overflow-x: hidden;
  background: var(--bg-primary);
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

/* ---- 100% Invisible Scrollbars Globally (Liquid Glass Clean UX) ---- */
html,
body,
*,
*::before,
*::after {
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE and Edge */
}

::-webkit-scrollbar,
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
  -webkit-appearance: none !important;
}

::-webkit-scrollbar-track,
*::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb,
::-webkit-scrollbar-corner,
*::-webkit-scrollbar-corner {
  display: none !important;
  background: transparent !important;
  border: none !important;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(96, 165, 249, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(167, 139, 250, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(73, 221, 127, 0.04) 0%, transparent 50%);
  z-index: 0;
  animation: bgShift 30s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-5%, 3%) rotate(3deg); }
}

/* ---- Layout: App Shell ---- */
.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---- Sidebar (Desktop) ---- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border-right: 1px solid var(--border-glass);
  padding: 24px 16px;
  transition: transform var(--transition-normal);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 32px;
}

.sidebar-logo .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-income), var(--accent-savings));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-green);
}

.sidebar-logo .logo-text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  opacity: 0;
  background: linear-gradient(135deg, rgba(96, 165, 249, 0.1), rgba(73, 221, 127, 0.05));
  transition: opacity var(--transition-fast);
}

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

.nav-item:hover::before {
  opacity: 1;
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  box-shadow: var(--shadow-sm);
}

.nav-item.active::before {
  opacity: 1;
}

.nav-item .nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.nav-item .nav-label {
  position: relative;
  z-index: 1;
}

/* ---- Main Content Area ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 24px 32px;
  min-height: 100vh;
}

.view-container {
  display: none;
  animation: fadeInUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  transform: translate3d(0, 0, 0);
}

.view-container.active {
  display: block;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin {
  animation: spin 1s linear infinite;
}

/* ---- View Header ---- */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.view-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.view-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Glass Card ---- */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ---- Hero Balance Card (Liquid Glass Desktop & Fullscreen) ---- */
.hero-balance-card {
  background: linear-gradient(135deg, rgba(37, 42, 56, 0.75) 0%, rgba(26, 30, 42, 0.9) 100%);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  transition: all var(--transition-normal);
}

.hero-balance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.hero-balance-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.hero-balance-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 260px;
}

.hero-balance-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-balance-label-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-icon-wrap {
  background: rgba(255, 255, 255, 0.08);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-balance-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.hero-balance-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.hero-balance-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.hero-balance-status.status-surplus {
  background: var(--accent-income-bg);
  color: var(--accent-income);
  border: 1px solid rgba(73, 221, 127, 0.25);
}

.hero-balance-status.status-deficit {
  background: var(--accent-expense-bg);
  color: var(--accent-expense);
  border: 1px solid rgba(247, 112, 112, 0.25);
}

.hero-balance-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.hero-balance-val {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-balance-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  display: none;
}

.hero-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.hero-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  white-space: nowrap;
  width: 100%;
}

.hero-action-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hero-action-btn.action-income:hover {
  background: var(--accent-income-bg);
  border-color: var(--accent-income);
  color: var(--accent-income);
}

.hero-action-btn.action-expense:hover {
  background: var(--accent-expense-bg);
  border-color: var(--accent-expense);
  color: var(--accent-expense);
}

.hero-action-btn.action-savings:hover {
  background: var(--accent-savings-bg);
  border-color: var(--accent-savings);
  color: var(--accent-savings);
}

/* ---- 2-per-row KPI Stats Grid ---- */
.kpi-grid-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .kpi-grid-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
}

/* ---- KPI Cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-clickable {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpi-clickable:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(255,255,255,0.05);
}

.kpi-card .kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.kpi-card .kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-card .kpi-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.kpi-card .kpi-change {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-card.income .kpi-icon { background: var(--accent-income-bg); color: var(--accent-income); }
.kpi-card.income .kpi-value { color: var(--accent-income); }
.kpi-card.expense .kpi-icon { background: var(--accent-expense-bg); color: var(--accent-expense); }
.kpi-card.expense .kpi-value { color: var(--accent-expense); }
.kpi-card.savings .kpi-icon { background: var(--accent-savings-bg); color: var(--accent-savings); }
.kpi-card.savings .kpi-value { color: var(--accent-savings); }
.kpi-card.balance .kpi-icon { background: var(--accent-purple-bg); color: var(--accent-purple); }
.kpi-card.balance .kpi-value { color: var(--accent-purple); }
.kpi-card.credit .kpi-icon { background: var(--accent-amber-bg); color: var(--accent-amber); }
.kpi-card.credit .kpi-value { color: var(--accent-amber); }

/* ---- Charts Section ---- */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-container {
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.chart-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

/* ---- Chart Mode Selector (Liquid Glass Pills) ---- */
.chart-mode-pills {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.chart-mode-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  font-family: inherit;
}

.chart-mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.chart-mode-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.chart-slot-hover {
  cursor: pointer;
  transition: fill 0.2s ease;
}

.chart-slot-hover:hover {
  fill: rgba(255, 255, 255, 0.06);
}

/* ---- Bar Chart (CSS custom) ---- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding-top: 20px;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.bar-group .bars {
  display: flex;
  gap: 2px;
  width: 100%;
  align-items: flex-end;
  height: calc(100% - 24px);
}

.bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.bar:hover {
  filter: brightness(1.2);
  transform: scaleY(1.03);
  transform-origin: bottom;
}

.bar.income-bar { background: linear-gradient(to top, var(--accent-income), rgba(73, 221, 127, 0.6)); }
.bar.expense-bar { background: linear-gradient(to top, var(--accent-expense), rgba(247, 112, 112, 0.6)); }
.bar.savings-bar { background: linear-gradient(to top, var(--accent-savings), rgba(96, 165, 249, 0.6)); }

.bar-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

/* ---- Donut Chart (CSS) ---- */
.donut-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex: 1;
  flex-wrap: wrap;
}

.donut-chart {
  width: 220px;
  height: 220px;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-slice {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, filter 0.2s ease;
  transform-origin: 100px 100px;
}

.donut-slice:hover, .donut-slice.active {
  transform: scale(1.06);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.25));
  opacity: 1 !important;
}

.donut-chart.has-hover .donut-slice:not(.active) {
  opacity: 0.35;
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 104px;
  height: 104px;
  background: rgba(29, 33, 45, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.donut-center .donut-total {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.donut-center .donut-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.donut-center .donut-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-income);
  margin-top: 2px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 220px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  border: 1px solid transparent;
  min-width: 0;
}

.legend-item:hover, .legend-item.active {
  background: var(--bg-card-hover);
  border-color: var(--border-glass);
  color: var(--text-primary);
  transform: translateX(4px);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.legend-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-value {
  margin-left: auto;
  flex-shrink: 0;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   Unified Table Architecture (Full-width header & sub-header scroll)
   ========================================================= */
.finza-table-card {
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.finza-table-header-wrap {
  width: 100%;
  background: rgba(26, 30, 42, 0.98);
  border-bottom: 1px solid var(--border-glass);
  overflow: hidden;
  flex-shrink: 0;
}

.finza-table-header-wrap table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.finza-table-body-wrap {
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 460px;
}

.finza-table-body-wrap table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.finza-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  background: transparent;
}

.finza-table th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.finza-table th.sortable:hover {
  color: var(--text-primary);
}

.finza-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  transition: background var(--transition-fast);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.finza-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.035);
}

.finza-table tbody tr.clickable-row {
  cursor: pointer;
  user-select: none;
}

.finza-table tbody tr.clickable-row:hover td {
  background: rgba(255, 255, 255, 0.065);
}

.finza-table .positive { color: var(--accent-income); font-weight: 600; }
.finza-table .negative { color: var(--accent-expense); font-weight: 600; }
.finza-table .savings-val { color: var(--accent-savings); font-weight: 600; }
.finza-table .bold-row td {
  font-weight: 700;
  border-top: 2px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
}

.finza-table-body-wrap::-webkit-scrollbar,
.finza-table-header-wrap::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Backward compatibility aliases */
.monthly-table-wrapper { width: 100%; }
.monthly-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.monthly-table th { padding: 12px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; text-align: left; }
.monthly-table td { padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.monthly-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.monthly-table .positive { color: var(--accent-income); }
.monthly-table .negative { color: var(--accent-expense); }
.monthly-table .savings-val { color: var(--accent-savings); }
.monthly-table .bold-row td { font-weight: 700; border-top: 2px solid var(--border-glass); }

/* Flujo badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-income {
  background: var(--accent-income-bg);
  color: var(--accent-income);
}

.badge-expense {
  background: var(--accent-expense-bg);
  color: var(--accent-expense);
}

.badge-savings {
  background: var(--accent-savings-bg);
  color: var(--accent-savings);
}

.badge-paid {
  background: var(--accent-income-bg);
  color: var(--accent-income);
}

.badge-pending {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

/* ---- Filters Bar ---- */
.filters-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select, .filter-input {
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  min-width: 130px;
}

.filter-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A2B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.filter-select:focus, .filter-input:focus {
  border-color: var(--accent-savings);
  box-shadow: 0 0 0 3px rgba(96, 165, 249, 0.15);
}

.filter-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-income), #38c96c);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-green);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(73, 221, 127, 0.25);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-active);
}

.btn-danger {
  background: var(--accent-expense-bg);
  color: var(--accent-expense);
  border: 1px solid rgba(247, 112, 112, 0.2);
}

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

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-edit:hover {
  color: var(--accent-savings) !important;
}

.btn-delete:hover {
  color: var(--accent-expense) !important;
}

/* Base SVG Rendering */
.lucide, i[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}

/* ---- FAB (Floating Action Button) ---- */
.fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-income), #38c96c);
  color: var(--bg-primary);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 24px rgba(73, 221, 127, 0.3);
  transition: all var(--transition-normal);
  z-index: 90;
  font-family: 'Inter', sans-serif;
}

.fab:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 32px rgba(73, 221, 127, 0.4);
}

.fab:active {
  transform: scale(0.95);
}

/* ---- Modal / Popup ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* Secondary / nested popup overlay */
.submodal-overlay {
  z-index: 250 !important;
  background: rgba(0, 0, 0, 0.75) !important;
}

.submodal-overlay.show {
  opacity: 1 !important;
  pointer-events: all !important;
}

.submodal-card {
  max-width: 440px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(73, 221, 127, 0.08) !important;
}

.modal {
  background: var(--bg-modal);
  backdrop-filter: var(--blur-modal);
  -webkit-backdrop-filter: var(--blur-modal);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.96) translate3d(0, 8px, 0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
  box-shadow: var(--shadow-lg);
  position: relative;
  will-change: transform, opacity;
}

.modal-overlay.show .modal {
  transform: scale(1) translate3d(0, 0, 0);
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

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

.modal-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--accent-expense-bg);
  color: var(--accent-expense);
  border-color: rgba(247, 112, 112, 0.2);
}

/* ---- Form ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--accent-savings);
  box-shadow: 0 0 0 3px rgba(96, 165, 249, 0.15);
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A2B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

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

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

.category-input-group {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.category-input-group .form-control {
  height: 40px !important;
  box-sizing: border-box;
}

.category-input-group .btn {
  height: 40px !important;
  box-sizing: border-box;
  padding: 0 16px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#profile-name-form .form-control,
#profile-name-form .btn {
  height: 40px !important;
  box-sizing: border-box;
}

/* ---- Empty State ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state .empty-text {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 300px;
}

/* ---- Tooltip (CSS) ---- */
.bar[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  pointer-events: none;
}

/* ---- Settings ---- */
.settings-grid {
  display: grid;
  gap: 16px;
}

.settings-section {
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.settings-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.settings-item-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle switch - Authentic iOS Liquid Glass */
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-block;
  user-select: none;
  box-sizing: border-box;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  top: 2px;
  left: 2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-income);
  border-color: var(--accent-income);
}

.toggle input:checked + .toggle-slider::before {
  background: #ffffff;
  transform: translateX(22px);
}

/* Tags / Category chips */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.tag .tag-remove {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(247, 112, 112, 0.2);
  color: var(--accent-expense);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag .tag-remove:hover {
  background: var(--accent-expense);
  color: var(--bg-primary);
}

/* ---- Credit specific ---- */
.credit-card-mini {
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.credit-card-mini::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

.credit-card-mini:hover {
  border-color: var(--border-active);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.credit-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.credit-progress {
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 12px 0;
}

.credit-progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-income), var(--accent-savings));
  transition: width var(--transition-slow);
}

.credit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.credit-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.credit-stat-value {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

.credits-grid {
  display: grid;
  gap: 12px;
}

/* ---- Credit Status Switch (Activos / Inactivos) ---- */
.credit-filter-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}

.credit-switch-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  user-select: none;
  font-family: inherit;
}

.credit-switch-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.credit-switch-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* Switch Activos (Green - var(--accent-income)) */
.credit-switch-btn.btn-activos {
  color: var(--accent-income) !important;
}

.credit-switch-btn.btn-activos:hover {
  background: rgba(73, 221, 127, 0.08);
}

.credit-switch-btn.btn-activos.active {
  background: rgba(73, 221, 127, 0.16) !important;
  color: var(--accent-income) !important;
  border: 1px solid rgba(73, 221, 127, 0.35) !important;
  box-shadow: 0 2px 12px rgba(73, 221, 127, 0.2) !important;
}

.credit-switch-btn.btn-activos .credit-switch-count {
  background: rgba(73, 221, 127, 0.15);
  color: var(--accent-income);
}

.credit-switch-btn.btn-activos.active .credit-switch-count {
  background: var(--accent-income);
  color: #0b0e14;
  font-weight: 800;
}

/* Switch Inactivos (Red - var(--accent-expense)) */
.credit-switch-btn.btn-inactivos {
  color: var(--accent-expense) !important;
}

.credit-switch-btn.btn-inactivos:hover {
  background: rgba(247, 112, 112, 0.08);
}

.credit-switch-btn.btn-inactivos.active {
  background: rgba(247, 112, 112, 0.16) !important;
  color: var(--accent-expense) !important;
  border: 1px solid rgba(247, 112, 112, 0.35) !important;
  box-shadow: 0 2px 12px rgba(247, 112, 112, 0.2) !important;
}

.credit-switch-btn.btn-inactivos .credit-switch-count {
  background: rgba(247, 112, 112, 0.15);
  color: var(--accent-expense);
}

.credit-switch-btn.btn-inactivos.active .credit-switch-count {
  background: var(--accent-expense);
  color: #fff;
  font-weight: 800;
}

.credit-switch-count {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
}

.credit-switch-btn.active .credit-switch-count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Credit installments table */
.installments-section {
  margin-top: 12px;
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.installments-section.expanded {
  max-height: 800px;
}

.credit-installments-table-card {
  border: 1px solid var(--border-glass);
  background: rgba(20, 24, 34, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.credit-installments-table-card .finza-table th,
.credit-installments-table-card .finza-table td {
  padding: 9px 12px;
}

.credit-installments-table .mobile-installment-date {
  display: none;
}

/* Clickable table rows with smooth hover */
tr.clickable-row {
  cursor: pointer;
  transition: background var(--transition-fast);
}

tr.clickable-row:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* ---- Month Selector (Pill format matching Year Selector) ---- */
.month-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px;
  position: relative;
}

.month-selector button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.month-selector button:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.month-display-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  cursor: pointer;
  min-width: 84px;
}

.month-selector .month-display {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.month-select-hidden {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  border: none;
  background: transparent;
  z-index: 5;
}

/* ---- Year Selector ---- */
.year-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 4px;
}

.year-selector button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.year-selector button:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.year-selector .year-display {
  font-size: 16px;
  font-weight: 700;
  padding: 0 8px;
  min-width: 60px;
  text-align: center;
}

/* ---- Pagination ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
  padding: 8px 0;
}

.pagination button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination button:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-active);
}

.pagination button.active {
  background: linear-gradient(135deg, var(--accent-savings), var(--accent-purple));
  color: white;
  border-color: transparent;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 8px;
}

/* ---- Record counts ---- */
.record-count {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.record-count strong {
  color: var(--text-secondary);
}

/* ---- Delete button in table ---- */
.delete-row-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-disabled);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0;
}

.data-table tbody tr:hover .delete-row-btn {
  opacity: 1;
}

.delete-row-btn:hover {
  background: var(--accent-expense-bg);
  color: var(--accent-expense);
  border-color: rgba(247, 112, 112, 0.2);
}

/* ---- Top Spending Categories (Dashboard) ---- */
.top-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.category-row:hover {
  background-color: rgba(42, 47, 64, 0.7);
}

.category-row .cat-name {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 140px;
  max-width: 140px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-row .cat-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.category-row .cat-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.category-row .cat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
  max-width: 100px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Mobile Top Bar ---- */
.mobile-top-bar {
  display: none;
}

/* Invisible Scrollbars for clean UX */
.no-scrollbar,
.autocomplete-dropdown,
.modal,
.modal-overlay,
.submodal-overlay,
.submodal-card,
.filters-modal-body,
.form-control,
select,
textarea,
.table-wrapper,
.finza-table-body-wrap,
.finza-table-header-wrap,
.mobile-filter-pills-wrap,
.year-selector-content {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.no-scrollbar::-webkit-scrollbar,
.autocomplete-dropdown::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.modal-overlay::-webkit-scrollbar,
.submodal-overlay::-webkit-scrollbar,
.submodal-card::-webkit-scrollbar,
.filters-modal-body::-webkit-scrollbar,
.form-control::-webkit-scrollbar,
select::-webkit-scrollbar,
textarea::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar,
.finza-table-body-wrap::-webkit-scrollbar,
.finza-table-header-wrap::-webkit-scrollbar,
.mobile-filter-pills-wrap::-webkit-scrollbar,
.year-selector-content::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.filters-modal {
  max-width: 480px;
}

/* ---- Mobile Top Bar Profile Chip ---- */
.mobile-top-actions {
  display: flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.profile-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 4px 5px 4px 12px !important;
  border-radius: 9999px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  user-select: none !important;
  -webkit-user-select: none !important;
  box-sizing: border-box !important;
}

.profile-chip:hover {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}

.profile-chip:active {
  transform: scale(0.96) !important;
}

.profile-name {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #FFFFFF !important;
  letter-spacing: -0.2px !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

.profile-avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #49DD7F 0%, #22D3EE 100%) !important;
  color: #0E1626 !important;
  font-weight: 800 !important;
  font-size: 12.5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 0 10px rgba(73, 221, 127, 0.4) !important;
  flex-shrink: 0 !important;
  line-height: 1 !important;
}

/* ---- Mobile Bottom Nav (Floating Liquid Glass Capsule - Reference Style) ---- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: calc(12px + var(--sab));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 390px;
  height: 50px;
  box-sizing: border-box;
  z-index: 130;
  background: rgba(18, 22, 33, 0.88);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  padding: 0 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.25), inset 0 -1px 1px rgba(0, 0, 0, 0.4);
  overflow: visible !important;
}

.bottom-nav-items {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: visible;
  position: relative;
}

.bottom-nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: rgba(255, 255, 255, 0.45);
  border: none;
  background: transparent;
  min-width: 40px;
  height: 36px;
  user-select: none;
  -webkit-user-select: none;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

.bottom-nav-item .bnav-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.bottom-nav-item .bnav-label {
  display: none !important;
}

.bottom-nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 2px 10px rgba(0, 0, 0, 0.35);
}

.bottom-nav-item.active .bnav-icon {
  transform: scale(1.1);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}

/* Central Prominent Action Button (Floating Liquid Glass Action Button - Reference Style) */
.bottom-nav-action-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  /* Finza Logo Gradient: Emerald neon green -> turquoise/mint -> cyan/electric blue */
  background: linear-gradient(140deg, #50F38E 0%, #20E3B2 45%, #06B6D4 82%, #0284C7 100%);
  color: #08171d;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 
    0 0 0 4px rgba(22, 26, 38, 0.96),
    0 0 0 5px rgba(255, 255, 255, 0.14),
    0 10px 24px -2px rgba(32, 227, 178, 0.55),
    0 0 28px 4px rgba(73, 221, 127, 0.42),
    inset 0 2px 3px rgba(255, 255, 255, 0.65),
    inset 0 -3px 4px rgba(0, 0, 0, 0.28);
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  margin: 0 4px;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  -webkit-user-select: none;
}

.bottom-nav-action-btn:hover {
  transform: scale(1.08);
  box-shadow: 
    0 0 0 4px rgba(22, 26, 38, 0.96),
    0 0 0 5.5px rgba(255, 255, 255, 0.22),
    0 12px 30px -2px rgba(32, 227, 178, 0.68),
    0 0 34px 6px rgba(73, 221, 127, 0.55),
    inset 0 2px 3px rgba(255, 255, 255, 0.75),
    inset 0 -3px 4px rgba(0, 0, 0, 0.28);
}

.bottom-nav-action-btn:active {
  transform: scale(0.92);
  box-shadow: 
    0 0 0 4px rgba(22, 26, 38, 0.96),
    0 4px 16px -2px rgba(32, 227, 178, 0.45),
    0 0 18px 2px rgba(73, 221, 127, 0.35);
}

.bottom-nav-action-btn i,
.bottom-nav-action-btn svg {
  color: #071918;
  width: 25px;
  height: 25px;
  stroke-width: 2.7;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bottom-nav-action-btn:hover i,
.bottom-nav-action-btn:hover svg {
  transform: rotate(90deg) scale(1.06);
}

/* Sidebar Action Button (Desktop) */
.sidebar-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #49DD7F 0%, #20E3B2 50%, #00C6FF 100%);
  color: #091a18;
  font-weight: 700;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(73, 221, 127, 0.35);
  transition: all var(--transition-fast);
  user-select: none;
  font-family: inherit;
}

.sidebar-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(73, 221, 127, 0.5);
  filter: brightness(1.05);
}

.sidebar-action-btn:active {
  transform: scale(0.97);
}

/* ---- Creation Modal & Segmented Switch Pills ---- */
.creation-modal {
  max-width: 520px;
}

.creation-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 18px;
}

.creation-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.creation-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #49DD7F;
  transition: color 0.2s ease;
}

.creation-modal-badge.credit-mode {
  color: #38BDF8;
}

.creation-modal-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.creation-modal-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #ffffff;
}

.modal-close-glass {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close-glass:hover {
  background: rgba(247, 112, 112, 0.18);
  color: var(--accent-expense);
  border-color: rgba(247, 112, 112, 0.35);
  transform: scale(1.06);
}

.creation-switch-container {
  width: 100%;
  margin-bottom: 22px;
}

.creation-pill-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
  background: rgba(14, 18, 26, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 5px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

.creation-pill-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  -webkit-user-select: none;
  font-family: inherit;
}

.creation-pill-btn .pill-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
}

.creation-pill-btn .pill-btn-text {
  font-weight: 700;
  letter-spacing: -0.2px;
}

.creation-pill-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Active Registro: Finza Logo Emerald Green */
.creation-pill-btn.active.tab-record {
  background: linear-gradient(135deg, rgba(73, 221, 127, 0.22) 0%, rgba(32, 227, 178, 0.15) 100%);
  color: #50F38E;
  border: 1px solid rgba(73, 221, 127, 0.45);
  box-shadow: 0 4px 18px rgba(73, 221, 127, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.creation-pill-btn.active.tab-record .pill-btn-icon {
  transform: scale(1.12);
  filter: drop-shadow(0 0 6px rgba(73, 221, 127, 0.65));
}

/* Active Crédito: Finza Logo Electric Blue / Cyan */
.creation-pill-btn.active.tab-credit {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, rgba(59, 130, 246, 0.15) 100%);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.creation-pill-btn.active.tab-credit .pill-btn-icon {
  transform: scale(1.12);
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.65));
}

.creation-pill-btn:active {
  transform: scale(0.96);
}

/* ---- Sheet Handle (iOS Bottom Sheet) ---- */
.sheet-handle {
  display: none;
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  margin: 0 auto 16px auto;
}

/* ---- Mobile Filter Pills (WhatsApp / Instagram style) ---- */
.mobile-filter-pills-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 12px;
  padding-bottom: 2px;
}

.mobile-filter-pills-wrap::-webkit-scrollbar {
  display: none;
}

.mobile-filter-pills {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 38px;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.pill-btn:active {
  transform: scale(0.96);
}

.pill-btn.active {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.pill-btn.income.active {
  background: rgba(73, 221, 127, 0.2);
  color: var(--accent-income);
  border-color: rgba(73, 221, 127, 0.4);
}

.pill-btn.expense.active {
  background: rgba(247, 112, 112, 0.2);
  color: var(--accent-expense);
  border-color: rgba(247, 112, 112, 0.4);
}

.pill-btn.savings.active {
  background: rgba(96, 165, 249, 0.2);
  color: var(--accent-savings);
  border-color: rgba(96, 165, 249, 0.4);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-income { background: var(--accent-income); }
.dot-expense { background: var(--accent-expense); }
.dot-savings { background: var(--accent-savings); }

/* ---- Search input wrap ---- */
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrap .search-input {
  padding-left: 36px;
  padding-right: 32px;
  width: 100%;
}

.search-input-wrap .search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}

/* ---- Mobile Records List (hidden on desktop) ---- */
.mobile-records-list {
  display: none;
}

/* ---- Responsive Category Bars (No overflow) ---- */
.responsive-categories {
  width: 100%;
  overflow: hidden;
}

.responsive-categories .category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.responsive-categories .cat-name {
  flex: 0 0 110px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.responsive-categories .cat-bar-bg {
  flex: 1;
  min-width: 40px;
}

.responsive-categories .cat-value {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
}

/* ========================================================
   ---- Full iOS Mobile Redesign Media Query (<= 768px) ----
   ======================================================== */
@media (max-width: 768px) {
  /* Prevent horizontal scrolling */
  html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  /* App Shell & Sidebar */
  .app-shell {
    display: block;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    display: none !important;
  }

  /* Mobile Bottom Navigation */
  .bottom-nav {
    display: flex !important;
    align-items: center;
  }

  /* Mobile Top Bar (Native iOS Header - Fixed / Inmovilizado) */
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    background: rgba(29, 33, 45, 0.88);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
    padding: calc(10px + var(--sat)) 16px 10px 16px;
    box-sizing: border-box;
    width: 100%;
  }

  .mobile-top-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-brand-icon img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: block;
    box-shadow: 0 2px 10px rgba(73, 221, 127, 0.25);
  }

  .mobile-brand-info {
    display: flex;
    flex-direction: column;
  }

  .mobile-brand-title {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.1;
    color: #FFFFFF;
  }

  .mobile-brand-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
  }

  .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-income);
    box-shadow: 0 0 6px var(--accent-income);
  }

  .mobile-nav-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
  }

  /* Main Content Area */
  .main-content {
    margin-left: 0 !important;
    padding: 14px 16px;
    padding-top: calc(66px + var(--sat)) !important;
    padding-bottom: calc(88px + var(--sab));
    padding-left: max(16px, var(--sal));
    padding-right: max(16px, var(--sar));
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* View Header */
  .view-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 10px;
  }

  .view-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
  }

  /* ---- Apple Wallet / Banking Hero Balance Card (Compact) ---- */
  .hero-balance-card,
  .hero-balance {
    grid-column: 1 / -1 !important;
    background: linear-gradient(135deg, rgba(42, 47, 64, 0.75) 0%, rgba(29, 33, 45, 0.95) 100%);
    border: 1px solid rgba(73, 221, 127, 0.28);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35), 0 0 24px rgba(73, 221, 127, 0.07);
    border-radius: 20px;
    padding: 15px 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
  }

  .hero-balance-card::after,
  .hero-balance::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(73, 221, 127, 0.15) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
  }

  .hero-balance-content {
    position: relative;
    z-index: 1;
  }

  .hero-balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
  }

  .hero-balance-label-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .hero-balance-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
  }

  .hero-balance-badge {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-weight: 600;
  }

  .hero-balance-val {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.1;
    margin-bottom: 10px;
  }

  .hero-balance-sub {
    display: none;
  }

  .hero-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    position: relative;
    z-index: 1;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .hero-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 38px;
    user-select: none;
    -webkit-user-select: none;
    white-space: nowrap;
    width: 100%;
  }

  .hero-action-btn:active {
    transform: scale(0.94);
  }

  .hero-action-btn.action-income {
    background: rgba(73, 221, 127, 0.14);
    color: var(--accent-income);
    border-color: rgba(73, 221, 127, 0.25);
  }

  .hero-action-btn.action-expense {
    background: rgba(247, 112, 112, 0.14);
    color: var(--accent-expense);
    border-color: rgba(247, 112, 112, 0.25);
  }

  .hero-action-btn.action-savings {
    background: rgba(96, 165, 249, 0.14);
    color: var(--accent-savings);
    border-color: rgba(96, 165, 249, 0.25);
  }

  /* Secondary KPI Grid (2x2) */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
  }

  .kpi-card {
    padding: 14px 14px;
    border-radius: 18px;
    min-height: 80px;
  }

  .kpi-card:active {
    transform: scale(0.97);
  }

  .kpi-card .kpi-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
    margin-bottom: 8px;
  }

  .kpi-card .kpi-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
  }

  .kpi-card .kpi-value {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
  }

  /* Charts Container */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    display: flex;
    flex-direction: column;
  }

  .chart-donut-container {
    order: 1 !important;
  }

  .chart-flow-container {
    order: 2 !important;
  }

  .chart-container {
    padding: 16px;
    border-radius: 18px;
  }

  .donut-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
  }

  /* Donut Legend on Mobile: strictly 2 equal-width columns prioritizing percentage */
  .donut-legend {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px 10px !important;
    width: 100% !important;
    max-height: none !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  .legend-item {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 7px 8px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 10px !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    font-size: 11.5px !important;
  }

  .legend-dot {
    width: 8px !important;
    height: 8px !important;
    flex-shrink: 0 !important;
  }

  .legend-name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: var(--text-secondary) !important;
    font-size: 11.5px !important;
  }

  .legend-value {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    white-space: nowrap !important;
    font-size: 11.5px !important;
    padding-left: 4px !important;
    font-variant-numeric: tabular-nums !important;
  }

  /* Mobile Tablero Adjustments */
  .monthly-summary-card {
    display: none !important;
  }

  .scheduled-credits-card {
    margin-left: 6px !important;
    margin-right: 6px !important;
    width: calc(100% - 12px) !important;
    box-sizing: border-box !important;
  }

  .scheduled-credits-card .finza-table th,
  .scheduled-credits-card .finza-table td {
    padding: 10px 8px !important;
  }

  .scheduled-credits-card .finza-table th:first-child,
  .scheduled-credits-card .finza-table td:first-child {
    padding-left: 14px !important;
  }

  .scheduled-credits-card .finza-table th:last-child,
  .scheduled-credits-card .finza-table td:last-child {
    padding-right: 14px !important;
  }

  /* Hide Desktop Table and Show Mobile Cards */
  .desktop-records-table {
    display: none !important;
  }

  .mobile-records-list {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
  }

  .mobile-record-card {
    background: rgba(30, 34, 48, 0.94);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 14px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    contain: content;
    transform: translateZ(0);
    will-change: transform;
  }

  .mobile-record-card:active {
    transform: scale(0.98) translateZ(0);
    background: var(--bg-card-hover);
    border-color: var(--border-active);
  }

  .mrec-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mrec-icon-income {
    background: rgba(73, 221, 127, 0.14);
    color: var(--accent-income);
    border: 1px solid rgba(73, 221, 127, 0.25);
  }

  .mrec-icon-expense {
    background: rgba(247, 112, 112, 0.14);
    color: var(--accent-expense);
    border: 1px solid rgba(247, 112, 112, 0.25);
  }

  .mrec-icon-savings {
    background: rgba(96, 165, 249, 0.14);
    color: var(--accent-savings);
    border: 1px solid rgba(96, 165, 249, 0.25);
  }

  .mrec-main {
    flex: 1;
    min-width: 0;
  }

  .mrec-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
  }

  .mrec-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mrec-cat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .mrec-amount {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    flex-shrink: 0;
  }

  .mrec-sub-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
  }

  .mrec-desc {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }

  .mrec-tags {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
  }

  .mrec-tag-pill {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
  }

  .mrec-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }

  .mrec-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .mrec-action-btn:active {
    transform: scale(0.9);
  }

  .mrec-action-btn.edit {
    display: none !important;
  }

  .mrec-action-btn.delete {
    color: var(--accent-expense);
  }

  /* Filters bar */
  .filters-bar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .filter-select, .filter-input {
    width: 100%;
    min-height: 48px;
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom! */
    border-radius: 14px;
  }

  .filter-clear-btn {
    min-height: 42px;
    justify-content: center;
  }

  /* Form & Settings Buttons Full Alignment */
  #profile-name-form .form-control,
  #profile-name-form .btn,
  .category-input-group .form-control,
  .category-input-group .btn {
    min-height: 48px !important;
    height: 48px !important;
    box-sizing: border-box !important;
  }

  .badge-paid,
  .badge-pending {
    white-space: nowrap !important;
  }

  /* ---- iOS Bottom Sheets (Modals) & Virtual Keyboard Support ---- */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
    transition: opacity var(--transition-normal), bottom 0.25s ease-out, height 0.25s ease-out;
  }

  .modal {
    width: 100% !important;
    max-width: 100vw !important;
    border-radius: 28px 28px 0 0 !important;
    border-bottom: none !important;
    margin: 0 !important;
    max-height: calc(100dvh - 30px) !important;
    max-height: calc(var(--visual-viewport-height, 100vh) - 30px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding: 16px 20px calc(24px + var(--sab)) 20px !important;
    transform: translate3d(0, 100%, 0) !important;
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), max-height 0.25s ease-out !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6) !important;
    will-change: transform;
  }

  .modal-overlay.show .modal {
    transform: translate3d(0, 0, 0) !important;
  }

  /* When virtual keyboard is detected active */
  body.keyboard-open .modal-overlay {
    bottom: var(--keyboard-height, 0px) !important;
    height: var(--visual-viewport-height, calc(100% - var(--keyboard-height, 0px))) !important;
  }

  body.keyboard-open .modal {
    max-height: calc(var(--visual-viewport-height, 100%) - 16px) !important;
    border-radius: 22px 22px 0 0 !important;
    padding-bottom: 24px !important;
  }

  .sheet-handle {
    display: block !important;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-control {
    font-size: 16px !important; /* Prevents iOS auto zoom */
    min-height: 48px;
    border-radius: 14px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
  }

  .form-actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    font-size: 15px;
    border-radius: 14px;
  }

  /* Floating Action Button (FAB) */
  .fab {
    bottom: calc(76px + var(--sab)) !important;
    right: 18px !important;
    width: 54px;
    height: 54px;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(73, 221, 127, 0.4);
  }

  /* iOS Dynamic Island / Banner Toast Notification */
  .toast-container {
    position: fixed !important;
    top: calc(14px + var(--sat)) !important;
    left: 16px !important;
    right: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    z-index: 10000 !important;
    pointer-events: none !important;
  }

  .toast {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 400px !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 40px rgba(0,0,0,0.65) !important;
    font-size: 14px !important;
    padding: 13px 16px 15px 16px !important;
    transform: translateY(-60px) scale(0.95) !important;
    opacity: 0 !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease !important;
  }

  .toast.show {
    transform: translateY(0) scale(1) !important;
    opacity: 1 !important;
  }

  .toast.hide {
    transform: translateY(-60px) scale(0.95) !important;
    opacity: 0 !important;
  }

  /* Settings Page Grouped Sections */
  .settings-section {
    border-radius: 18px;
    padding: 18px;
  }

  .settings-item {
    padding: 14px 0;
    min-height: 48px;
  }

  /* Credits Virtual Cards */
  .credit-card-mini {
    background: rgba(30, 34, 48, 0.94);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 20px;
    padding: 16px 14px;
    contain: content;
    transform: translateZ(0);
  }

  /* Installments table in mobile: widen to card borders leaving 6px margin matching Tablero */
  .installments-section .credit-installments-table-card {
    margin-left: -8px !important;
    margin-right: -8px !important;
    width: calc(100% + 16px) !important;
    box-sizing: border-box !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(18, 22, 32, 0.8) !important;
  }

  /* Detalle de cuotas table on mobile: prioritize complete visibility of CUOTA, MONTO, and ESTADO */
  .credit-installments-table {
    table-layout: fixed !important;
    width: 100% !important;
  }

  .credit-installments-table .col-fecha {
    display: none !important;
  }

  .credit-installments-table .mobile-installment-date {
    display: block !important;
    font-size: 10px !important;
    color: var(--text-muted) !important;
    font-weight: 400 !important;
    margin-top: 2px !important;
    white-space: nowrap !important;
    font-variant-numeric: tabular-nums !important;
  }

  .credit-installments-table th.col-cuota,
  .credit-installments-table td.col-cuota {
    width: 28% !important;
    padding-left: 14px !important;
    padding-right: 4px !important;
    vertical-align: middle !important;
  }

  .credit-installments-table th.col-monto,
  .credit-installments-table td.col-monto {
    width: 38% !important;
    text-align: right !important;
    padding-right: 12px !important;
    padding-left: 4px !important;
    font-size: 12.5px !important;
    vertical-align: middle !important;
  }

  .credit-installments-table th.col-estado,
  .credit-installments-table td.col-estado {
    width: 34% !important;
    text-align: center !important;
    padding-right: 14px !important;
    padding-left: 6px !important;
    vertical-align: middle !important;
  }

  .credit-installments-table th {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    font-size: 11px !important;
    letter-spacing: 0.5px !important;
  }

  .credit-installments-table td {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .credit-installments-table .badge-paid,
  .credit-installments-table .badge-pending {
    padding: 3px 8px !important;
    font-size: 10.5px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 64px !important;
  }

  /* Pagination */
  .pagination {
    gap: 6px;
  }

  .pagination button {
    min-width: 40px;
    min-height: 40px;
    font-size: 14px;
    border-radius: 12px;
  }
}

/* Extra small devices (iPhone SE / mini <= 380px) */
@media (max-width: 380px) {
  .hero-balance-val {
    font-size: 26px;
  }
  .hero-action-btn {
    font-size: 11px;
    padding: 8px 4px;
  }
  .kpi-card .kpi-value {
    font-size: 15px;
  }
}

/* ---- Number formatting ---- */
.amount-positive { color: var(--accent-income); font-weight: 600; }
.amount-negative { color: var(--accent-expense); font-weight: 600; }
.amount-neutral { color: var(--accent-savings); font-weight: 600; }

/* ---- Toast Notification (Base & Desktop) ---- */
.toast {
  background: rgba(30, 34, 48, 0.95);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 13px 18px 15px 18px;
  font-size: 13.5px;
  color: var(--text-primary);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  pointer-events: auto;
}

@media (min-width: 769px) {
  .toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
  }

  .toast {
    min-width: 270px;
    max-width: 420px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  }

  .toast.show {
    transform: translateX(0);
    opacity: 1;
  }

  .toast.hide {
    transform: translateX(120%) scale(0.95);
    opacity: 0;
  }

  /* Installments table optimization for desktop / PC (full screen) */
  .installments-section .credit-installments-table-card {
    max-width: 780px;
    margin: 12px auto 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  }

  .installments-section .credit-installments-table-card .finza-table th,
  .installments-section .credit-installments-table-card .finza-table td {
    padding: 10px 18px;
  }

  /* Desktop Charts: Flujo Anual (Left) and Distribución de Egresos (Right) of equal size */
  .dashboard-charts-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    align-items: stretch !important;
  }

  /* Desktop KPI Cards: Ingresos Totales, Egresos Totales, Ahorro Total, Egreso T. Crédito on a single row */
  .kpi-grid-stats {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
  }
}

.toast.success { border-left: 3.5px solid var(--accent-income); }
.toast.error { border-left: 3.5px solid var(--accent-expense); }
.toast.info { border-left: 3.5px solid var(--accent-savings); }

/* Progress bar inside Toast that drains from 100% to 0% */
.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  animation-name: toastDrainingProgress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  z-index: 1;
}

.toast.success .toast-progress-bar {
  background: linear-gradient(90deg, #49DD7F, #38c96c);
  box-shadow: 0 0 10px rgba(73, 221, 127, 0.7);
}

.toast.error .toast-progress-bar {
  background: linear-gradient(90deg, #F77070, #ef4444);
  box-shadow: 0 0 10px rgba(247, 112, 112, 0.7);
}

.toast.info .toast-progress-bar {
  background: linear-gradient(90deg, #60A5F9, #3b82f6);
  box-shadow: 0 0 10px rgba(96, 165, 249, 0.7);
}

@keyframes toastDrainingProgress {
  0% {
    width: 100%;
    opacity: 1;
  }
  96% {
    opacity: 1;
  }
  100% {
    width: 0%;
    opacity: 0.3;
  }
}

/* Action link in tables */
.action-expand {
  cursor: pointer;
  color: var(--accent-savings);
  font-size: 12px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.action-expand:hover {
  color: var(--text-primary);
}

/* ---- Tooltips and Interactive Dashboard Elements ---- */
.dashboard-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  background: rgba(29, 33, 45, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dashboard-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.interactive-element {
  cursor: pointer;
  transition: filter var(--transition-fast), stroke-width var(--transition-fast), transform var(--transition-fast);
}

.interactive-element:hover {
  filter: brightness(1.25) drop-shadow(0 0 6px rgba(255,255,255,0.3));
}

circle.interactive-element:hover {
  stroke-width: 6;
}

.legend-item.interactive-element:hover {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

/* ---- Liquid Glass Autocomplete Component ---- */
.autocomplete-wrapper {
  position: relative;
  width: 100%;
}

.autocomplete-input-wrap {
  position: relative;
  width: 100%;
}

.autocomplete-input-wrap .form-control {
  padding-right: 36px;
}

.autocomplete-toggle-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.autocomplete-wrapper.open .autocomplete-toggle-icon {
  transform: translateY(-50%) rotate(180deg);
  color: var(--text-primary);
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(28, 33, 46, 0.96);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.15);
  z-index: 1050;
  display: none;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
}

.autocomplete-dropdown.show {
  display: flex;
  animation: fadeInAutocomplete 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInAutocomplete {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  border: 1px solid transparent;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: var(--bg-card-hover);
  border-color: var(--border-glass);
}

.autocomplete-item.selected {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.35);
  font-weight: 600;
}

.autocomplete-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.autocomplete-item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item-name mark {
  background: transparent;
  color: var(--accent-income);
  font-weight: 700;
  text-decoration: underline;
  padding: 0;
}

.autocomplete-create-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-income);
  border-top: 1px solid var(--border-glass);
  margin-top: 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.autocomplete-create-btn:hover,
.autocomplete-create-btn.highlighted {
  background: rgba(73, 221, 127, 0.12);
}

.autocomplete-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Hide all navigation elements when in login screen */
body.in-login-view .bottom-nav,
body.in-login-view .mobile-top-bar,
body.in-login-view #bottom-nav,
body.in-login-view #mobile-top-bar,
body.in-login-view .sidebar {
  display: none !important;
}

.login-view-container {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 100;
  background: var(--bg-primary);
  box-sizing: border-box;
}

.login-card {
  width: 100%;
  max-width: 390px;
  background: rgba(28, 33, 46, 0.82);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  padding: 34px 26px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  position: relative;
}

.login-logo-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 20px;
  display: block;
}

.login-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: #ffffff;
  margin-bottom: 3px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.login-field {
  margin-bottom: 18px;
}

.login-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  outline: none;
  box-sizing: border-box;
}

.login-input:focus {
  border-color: var(--accent-income);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 16px rgba(73, 221, 127, 0.22);
}

.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #49DD7F 0%, #22D3EE 100%);
  color: #0B1921;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(73, 221, 127, 0.35);
  margin-top: 24px;
}

.login-btn:active {
  transform: scale(0.97);
}

.login-error {
  background: rgba(247, 112, 112, 0.14);
  border: 1px solid rgba(247, 112, 112, 0.3);
  color: #ff9191;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12.5px;
  margin-bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
}

/* =========================================================
   RECORDS FILTER BAR (Search Bar and Filter Button Perfect Height & Alignment)
   ========================================================= */
.records-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
}

.records-filter-row .search-input-wrap {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  height: 44px;
  position: relative;
  display: flex;
  align-items: center;
}

.records-filter-row .search-input {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
  border-radius: 14px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 42px !important;
  font-size: 14px !important;
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border-radius: 14px !important;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  box-sizing: border-box !important;
  user-select: none;
  -webkit-user-select: none;
  line-height: 1;
}

.filter-toggle-btn:active {
  transform: scale(0.96);
}

.filter-toggle-btn.has-filters {
  background: rgba(73, 221, 127, 0.15);
  border-color: rgba(73, 221, 127, 0.35);
  color: var(--accent-income);
}

.filter-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-income);
  box-shadow: 0 0 6px var(--accent-income);
  display: inline-block;
}

/* Profile Modal Details */
.profile-modal-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #49DD7F 0%, #22D3EE 100%);
  color: #0E1626;
  font-weight: 800;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(73, 221, 127, 0.35);
  margin: 0 auto 14px auto;
}

