@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  --primary: #0ea5e9;           /* Vibrant Cyan/Royal Blue matching logo base */
  --primary-hover: #0284c7;
  --primary-light: rgba(14, 165, 233, 0.1);
  --secondary: #10B981;         /* Emerald Green matching logo top */
  --accent: #06B6D4;            /* Teal matching logo middle */

  --bg-main: #F4F6FA;           /* Crisp elegant light background */
  --bg-card: rgba(255, 255, 255, 0.85); /* Semi-transparent white glass */
  --bg-card-solid: #FFFFFF;
  --bg-sidebar: #FFFFFF;

  --text-primary: #0F172A;      /* Deep Slate text matching logo text */
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;

  --border-color: rgba(14, 165, 233, 0.09);
  --border-card: rgba(14, 165, 233, 0.08);

  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;

  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(14, 165, 233, 0.12);
  --glass-shadow: 0 16px 36px rgba(14, 165, 233, 0.05);

  --font-main: 'Outfit', -apple-system, sans-serif;
  --font-heading: 'Plus Jakarta Sans', var(--font-main);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;

  --shadow-sm: 0 4px 12px rgba(0,0,0,0.02);
  --shadow-md: 0 12px 30px rgba(14, 165, 233, 0.04);
  --shadow-lg: 0 24px 50px rgba(14, 165, 233, 0.08);
  --shadow-primary: 0 8px 30px rgba(14, 165, 233, 0.2);
}

/* Premium Cosmic Dark Theme - default & dynamic */
[data-theme="dark"] {
  --primary: #38bdf8;           /* Light Sky Blue */
  --primary-hover: #0ea5e9;
  --primary-light: rgba(56, 189, 248, 0.15);
  --bg-main: #070b19;           /* Deep elegant navy midnight void from logo text style */
  --bg-card: rgba(11, 19, 43, 0.65); /* Highly-transparent neomorphic deep glass */
  --bg-card-solid: #0d1632;
  --bg-sidebar: #070b19;
  --text-primary: #F8FAFC;      /* Crisp pure white */
  --text-secondary: #94A3B8;    /* Premium slate grey */
  --text-tertiary: #64748B;
  --border-color: rgba(255, 255, 255, 0.06);
  --border-card: rgba(56, 189, 248, 0.15);
  --glass-bg: rgba(11, 19, 43, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.55);
}

[data-theme="standard"] {
  /* Default Theme */
}


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

input, select, textarea, button, a, [onclick], .qt-pill-btn, .txn-menu-btn, .txn-item {
  touch-action: manipulation;
}

html {
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: row;
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden;
}

/* Splash Screen */
#appSplash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e3a5f 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.5s ease;
}

#appSplash.hidden {
  opacity: 0;
  pointer-events: none;
}

#appSplash img {
  width: 100px;
  height: 100px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: splashPulse 1.5s ease-in-out infinite;
}

#appSplash h1 {
  color: white;
  font-size: 2rem;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -1px;
}

#appSplash p {
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 30px 80px rgba(99,102,241,0.5); }
}

/* Login Overlay */
#loginOverlay {
  z-index: 99998 !important;
}

/* PIN Lock Overlay */
#pinLockOverlay {
  z-index: 99997 !important;
}


h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, select {
  font-family: inherit;
  outline: none;
}

select option {
  background: var(--bg-card-solid) !important;
  color: var(--text-primary) !important;
}

/* Glassmorphism Utilities */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), transparent);
  opacity: 0.15;
  transition: var(--transition);
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
}

.glass-card:hover::before {
  opacity: 0.8;
}

.glass-card:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.25);
}

/* Typography */
.page-title {
  font-size: 2rem;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Two-line Dashboard Greeting */
.greeting-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 2px !important;
  margin: 0 !important;
}
.greeting-prefix {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  opacity: 0.85 !important;
  color: var(--text-secondary) !important;
  line-height: 1.2 !important;
}
.greeting-name {
  font-size: 2rem !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.5px !important;
  line-height: 1.2 !important;
}

#homeProfilePicContainer {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
#homeProfilePicContainer:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4) !important;
  border-color: var(--primary) !important;
}

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

.section-header h2 {
  font-size: 1.25rem;
}

.see-all {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-weight: 600;
  border: 2px solid var(--border-color);
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--text-secondary);
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: var(--transition);
}

.btn-ghost:hover {
  background: var(--border-color);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #C2410C);
  color: white;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #C2410C, var(--danger));
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.35);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* Layout */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - 40px);
  position: fixed;
  top: 20px;
  left: 20px;
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(14, 165, 233, 0.05);
}

.sidebar-brand {
  padding: 32px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-links {
  flex: 1;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-item:not(.sidebar-profile-card):hover {
  background: var(--glass-bg);
  color: var(--text-primary);
  transform: translateX(6px);
}

.nav-item:not(.sidebar-profile-card)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
  transition: transform 0.2s ease;
}

.nav-item:not(.sidebar-profile-card).active::before,
.nav-item:not(.sidebar-profile-card):hover::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--primary-light), rgba(99, 102, 241, 0.04));
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.2), var(--shadow-sm);
  border-radius: var(--radius-md);
}

.nav-icon {
  font-size: 1.25rem;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--border-color);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-main);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.toggle-switch {
  width: 44px;
  height: 24px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  transition: var(--transition);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
}

[data-theme="dark"] .toggle-switch {
  background: var(--primary);
}

[data-theme="dark"] .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-switch.active {
  background: var(--primary) !important;
}

.toggle-switch.active::after {
  transform: translateX(20px) !important;
}

/* Main Content Area */
.main-content {
  flex: 1;
  min-width: 0;          /* KEY: prevents flex children from overflowing */
  width: 0;              /* forces flex to calculate proper size */
  margin-left: 320px;    /* Beautiful gap matching 280px width + 20px gap + 20px padding */
  padding: 32px 48px;
  position: relative;
  min-height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.page {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.page.active {
  display: block;
}

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

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

/* Home Page Specifics */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 1px; left: 1px; right: 1px;
  height: 3px;
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
}

.card-total::before { background: linear-gradient(90deg, var(--primary), #a78bfa); }
.card-today::before { background: linear-gradient(90deg, var(--success), #34d399); }
.card-budget::before { background: linear-gradient(90deg, var(--danger), #f87171); }
.card-savings::before { background: linear-gradient(90deg, var(--accent), #fbbf24); }

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

.card-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.card-amount {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.card-trend {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  opacity: 0.15;
}

.card-total { border-bottom: none; }
.card-today { border-bottom: none; }
.card-budget { border-bottom: none; }
.card-savings { border-bottom: none; }

/* Budget Progress Bar */
.budget-progress-card {
  margin-bottom: 32px;
}

.badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.budget-bar-wrap {
  position: relative;
  margin: 16px 0;
}

.budget-bar {
  height: 12px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.budget-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.budget-pct-label {
  position: absolute;
  right: 0;
  top: -24px;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--primary);
}

.budget-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Category List */
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.cat-item:hover {
  background: var(--border-color);
}

.cat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  border-radius: 50%;
  font-size: 1.25rem;
}

.cat-details {
  display: flex;
  flex-direction: column;
}

.cat-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.cat-amount {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Transactions List */
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.txn-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: var(--transition);
  animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.txn-item.deleting {
  animation: fadeOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateY(-16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
    max-height: 100px;
    margin-bottom: 12px;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  100% {
    opacity: 0;
    transform: scale(0.9) translateY(16px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.txn-item:hover {
  border-color: var(--primary);
}

.txn-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.txn-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.txn-info {
  display: flex;
  flex-direction: column;
}

.txn-title {
  font-weight: 600;
  font-size: 1rem;
}

.txn-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.txn-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.txn-amount {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.txn-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.txn-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.txn-item:hover .txn-actions {
  opacity: 1;
}

.action-btn {
  padding: 4px;
  color: var(--text-tertiary);
  font-size: 1rem;
}

.action-btn:hover.delete-btn {
  color: var(--danger);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  color: var(--text-secondary);
  text-align: center;
}

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

.empty-state p {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
}

/* Filters */
.filter-card {
  margin-bottom: 24px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.filter-select, .filter-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: var(--transition);
  box-sizing: border-box;
  max-width: 100%;
}

.filter-select:focus, .filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-filter {
  height: 40px;
}

.search-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-main);
  color: var(--text-primary);
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  background: var(--bg-card-solid);
}

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

.pill {
  padding: 4px 12px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill-close {
  cursor: pointer;
  color: var(--text-tertiary);
}

.pill-close:hover {
  color: var(--danger);
}

/* Stats Row */
.txn-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.txn-stat-card {
  background: var(--bg-card-solid);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.txn-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.txn-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-heading);
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
}

/* Reports */
.report-period-btns {
  display: flex;
  background: var(--bg-card-solid);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.period-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.period-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.report-cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.report-stat-card {
  background: linear-gradient(135deg, var(--bg-card-solid), var(--bg-main));
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.rsc-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
}

.rsc-value {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  margin: 8px 0;
  color: var(--primary);
}

.rsc-sub {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.chart-card h2 {
  font-size: 1.125rem;
  margin-bottom: 16px;
}

.chart-wrap {
  width: 100%;
  height: 300px;
  position: relative;
  overflow: hidden;
}
.chart-wrap canvas {
  max-width: 100% !important;
  display: block;
}

.chart-doughnut-wrap {
  height: 250px;
  display: flex;
  justify-content: center;
}

.report-table-wrap {
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.report-table th, .report-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.report-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
}

.report-table tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}

/* Budget Page */
.budget-hero-card {
  background: linear-gradient(135deg, var(--bg-card-solid), var(--bg-main));
  margin-bottom: 32px;
  border: 1px solid var(--border-color);
}

.budget-hero-content {
  display: flex;
  align-items: center;
  gap: 48px;
}

.budget-hero-ring {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
}

.budget-hero-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.bhi-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-color);
}

.bhi-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.bhi-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

.bhi-spent { color: var(--warning); }
.bhi-remaining { color: var(--success); }

.cat-budget-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-budget-item {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}

.cbi-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cbi-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.cbi-amounts {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.cbi-amounts strong {
  color: var(--text-primary);
}

/* Settings Page Overhaul */
.settings-grid {
  column-count: 3;
  column-gap: 24px;
}

@media (max-width: 1200px) {
  .settings-grid {
    column-count: 2;
  }
}

@media (max-width: 768px) {
  .settings-grid {
    column-count: 1;
  }
}

.settings-card {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  position: relative;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  display: inline-block;
  width: 100%;
  margin-bottom: 24px;
  break-inside: avoid;
  box-sizing: border-box;
}

.settings-card::before {
  content: '';
  position: absolute;
  top: 1px; left: 1px; right: 1px;
  height: 4px;
  border-top-left-radius: calc(var(--radius-lg) - 1px);
  border-top-right-radius: calc(var(--radius-lg) - 1px);
  background: linear-gradient(90deg, var(--primary), #a78bfa);
}

.settings-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.15);
}

/* Red-danger top highlight for danger card */
.settings-card.danger-card::before {
  background: linear-gradient(90deg, var(--danger), #f87171) !important;
}

.settings-card.danger-card:hover {
  border-color: var(--danger);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.12);
}

.settings-card h2 {
  font-size: 1.35rem;
  font-family: var(--font-heading);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 12px;
}

.setting-row {
  margin-bottom: 20px;
}

.setting-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.setting-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card-solid);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.setting-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.btn-save {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.custom-cats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.custom-cat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.add-cat-row {
  display: flex;
  gap: 8px;
}

.danger-card {
  border-color: rgba(239, 68, 68, 0.3);
}

.danger-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.danger-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.modal {
  background: var(--bg-card-solid);
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(20px);
  transition: transform 0.3s;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.5rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.required {
  color: var(--danger);
}

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

.currency-prefix {
  position: absolute;
  left: 16px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.amount-input {
  width: 100%;
  padding: 16px 16px 16px 40px;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-main);
  color: var(--text-primary);
  transition: var(--transition);
}

.amount-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.category-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.cat-pick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.cat-pick-item:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-main);
}

.cat-pick-item.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.cat-pick-icon {
  font-size: 1.5rem;
}

.cat-pick-name {
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

/* Confirm Dialog */
.confirm-modal {
  max-width: 400px;
  text-align: center;
  padding: 32px;
}

.confirm-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.confirm-modal h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.confirm-modal p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.confirm-modal .form-actions {
  justify-content: center;
  margin-top: 0;
  padding-top: 0;
  border: none;
}

/* Toast Notification Card */
.toast {
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 100000;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90%;
  width: auto;
  min-width: 280px;
  text-align: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.toast.show {
  top: 24px;
}

/* Toast Color Variations */
.toast-success {
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  border-left: 5px solid #059669;
  border-top: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.toast-danger {
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
  border-left: 5px solid #dc2626;
  border-top: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.toast-info {
  background: rgba(30, 41, 59, 0.95);
  color: #ffffff;
  border-left: 5px solid var(--primary);
  border-top: 1px solid rgba(255,255,255,0.15);
  border-right: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.toast-online {
  background: var(--bg-card);
  color: var(--text-primary);
  border-left: 5px solid var(--success);
  border-top: 1.5px solid var(--border-color);
  border-right: 1.5px solid var(--border-color);
  border-bottom: 1.5px solid var(--border-color);
}

/* Bottom Nav (Mobile Only) */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
  z-index: 1000;
  justify-content: space-between;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.bottom-nav-item span:first-child {
  font-size: 1.5rem;
  margin-bottom: 2px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.add-btn-mobile {
  position: relative;
  top: -20px;
}

.add-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* === RESPONSIVE DESIGN === */

/* Desktop (> 768px): Sidebar always visible, no bottom nav */
@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0) !important;
    display: flex !important;
  }

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

  .main-content {
    margin-left: var(--sidebar-width);
    padding: 32px 48px;
  }

  .btn-add-desktop {
    display: flex !important;
  }
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
  .main-content {
    padding: 28px 32px;
  }
}

/* Mobile (< 768px): No sidebar, show bottom nav */
@media (max-width: 768px) {
  html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
  }

  /* Prevent auto zoom-in on mobile inputs */
  input, select, textarea {
    font-size: 16px !important;
  }

  .sidebar {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 20px 12px 100px;
    max-width: 100vw;
    overflow-x: hidden !important;
    box-sizing: border-box;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .summary-card {
    padding: 16px 12px 14px 12px !important;
    border-radius: var(--radius-md) !important;
  }

  .summary-card .card-label {
    font-size: 0.7rem !important;
    margin-bottom: 6px !important;
  }

  .summary-card .card-amount {
    font-size: 1.25rem !important;
    margin-bottom: 2px !important;
    letter-spacing: -0.2px !important;
  }

  .summary-card .card-trend {
    font-size: 0.65rem !important;
  }

  .summary-card .card-icon {
    font-size: 1.6rem !important;
    right: 10px !important;
    bottom: 10px !important;
  }

  .bottom-nav {
    display: flex !important;
  }

  .btn-add-desktop {
    display: none !important;
  }

  .page-header {
    position: relative !important;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 50%, #a855f7 100%) !important;
    padding: 30px 20px 42px 20px !important;
    margin: -20px -12px 24px -12px !important;
    border-radius: 0 0 28px 28px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 16px !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.22), inset 0 -4px 12px rgba(255, 255, 255, 0.08) !important;
    width: calc(100% + 24px) !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Ambient Glow Overlays */
  .page-header::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    right: -20% !important;
    width: 180px !important;
    height: 180px !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%) !important;
    pointer-events: none !important;
    z-index: 1 !important;
  }

  .page-header::after {
    content: '' !important;
    position: absolute !important;
    bottom: -20% !important;
    left: -10% !important;
    width: 150px !important;
    height: 150px !important;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 60%) !important;
    pointer-events: none !important;
    z-index: 1 !important;
  }

  .page-header > * {
    position: relative !important;
    z-index: 2 !important;
  }

  .page-header .page-title, .page-header .page-subtitle, .page-header span {
    color: #ffffff !important;
  }

  .greeting-prefix {
    font-size: 0.78rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    letter-spacing: 0.8px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  }

  .greeting-name {
    font-size: 1.55rem !important;
    color: #ffffff !important;
    letter-spacing: -0.3px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  }

  /* Profile Avatar Glow and Pulse */
  #homeProfilePicContainer {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    border: 2.5px solid rgba(255, 255, 255, 0.85) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    background: var(--bg-card) !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }

  #homeProfilePicContainer:active {
    transform: scale(1.06) !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4) !important;
  }

  .section-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
  }

  .budget-hero-content {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }

  .report-cards-row {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
  }

  .filters-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .filter-group {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .filter-select, .filter-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .glass-card {
    padding: 16px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .modal {
    max-width: calc(100vw - 32px);
    margin: 0 16px;
  }

  /* Tighten list layout for mobile screens */
  .txn-item {
    padding: 12px 14px !important;
  }
  .txn-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
  }
  .txn-left {
    gap: 12px !important;
  }
  .txn-title {
    font-size: 0.9rem !important;
  }
  .txn-desc {
    font-size: 0.7rem !important;
  }
  .txn-amount {
    font-size: 1rem !important;
  }
  .txn-date {
    font-size: 0.7rem !important;
  }

  /* Show Set Budget and New Goal Buttons in Mobile Headers */
  #page-budget .btn-add-desktop,
  #page-goals .btn-add-desktop {
    display: flex !important;
    background: rgba(255, 255, 255, 0.18) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
  }
  #page-budget .btn-add-desktop:active,
  #page-goals .btn-add-desktop:active {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(1px) !important;
  }

  /* Mobile Menu Overlay Backdrop */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 30, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Keep Active Background Page Visible */
  .page.active:not(#page-settings) {
    display: block !important;
  }

  /* Right-side Sliding Settings Drawer on Mobile */
  #page-settings {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 86% !important;
    max-width: 390px !important;
    height: 100% !important;
    background: var(--bg-card-solid, var(--bg-card)) !important;
    z-index: 2100 !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.35) !important;
    transform: translateX(100%) !important;
    box-sizing: border-box !important;
    padding: 0 !important; /* Reset padding here so header & footer can stick */
    overflow: hidden !important; /* Scroll strictly inside drawer-body-wrap */
    margin: 0 !important;
    border-radius: 24px 0 0 24px !important;
    border: 1px solid var(--border-color) !important;
    border-right: none !important;
    flex-direction: column !important;
  }
  #page-settings.drawer-ready {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  [data-theme="dark"] #page-settings {
    background: #0f172a !important;
  }
  #page-settings.drawer-active {
    display: flex !important; /* Must display as flex when active */
    transform: translateX(0) !important;
  }

  /* Hide standard Settings header on mobile drawer */
  #page-settings .page-header:not(.drawer-header) {
    display: none !important;
  }

  /* Drawer Header styling - Fixed at top */
  .drawer-header {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: calc(32px + env(safe-area-inset-top, 0px)) 16px 16px 16px !important;
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    border-bottom: 1.5px solid var(--border-color) !important;
    background: var(--bg-card-solid, var(--bg-card)) !important;
    border-radius: 24px 0 0 0 !important;
    z-index: 5 !important;
  }
  [data-theme="dark"] .drawer-header {
    background: #0f172a !important;
  }

  .drawer-header-top {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 4px !important;
  }

  .drawer-brand-small {
    font-size: 0.84rem !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    text-transform: lowercase !important;
    letter-spacing: 2px !important;
    opacity: 0.9 !important;
    margin: 0 !important;
    font-family: var(--font-heading) !important;
    user-select: none !important;
  }

  /* Scrollable Drawer Body Wrap */
  .drawer-body-wrap {
    flex-grow: 1 !important;
    overflow-y: auto !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Sticky Drawer Footer Wrap - Fixed at bottom */
  .drawer-footer-wrap {
    flex-shrink: 0 !important;
    padding: 14px 16px 24px 16px !important;
    background: var(--bg-card-solid, var(--bg-card)) !important;
    border-top: 1.5px solid var(--border-color) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    border-radius: 0 0 0 24px !important;
    z-index: 5 !important;
  }
  [data-theme="dark"] .drawer-footer-wrap {
    background: #0f172a !important;
  }
  .drawer-close-btn {
    background: var(--glass-bg, rgba(255,255,255,0.05)) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    font-size: 1.1rem !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.2s ease !important;
  }
  .drawer-close-btn:active {
    transform: scale(0.9) !important;
  }
  .drawer-welcome-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%) !important;
    border: 1px solid var(--border-color) !important;
    padding: 14px 16px !important;
    border-radius: 16px !important;
  }
  .drawer-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    border: 2.5px solid var(--primary) !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25) !important;
    flex-shrink: 0 !important;
  }
  .drawer-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  .drawer-user-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
  }
  .drawer-greeting {
    font-size: 0.65rem !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    font-weight: 700 !important;
  }
  .drawer-username {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    font-family: var(--font-heading) !important;
  }
  .drawer-plan-badge {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    color: white !important;
    background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    display: inline-block !important;
    align-self: flex-start !important;
    margin-top: 1px !important;
  }

  /* Quick Actions Styling */
  .quick-actions-card {
    padding: 14px 16px !important;
    margin-bottom: 20px !important;
  }
  .quick-actions-card h2 {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
  }
  .quick-actions-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }
  .quick-action-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    background: var(--bg-main) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 8px 2px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: var(--shadow-sm) !important;
  }
  .quick-action-btn:active {
    transform: scale(0.95) !important;
    background: var(--border-color) !important;
  }
  .quick-action-btn .btn-icon {
    font-size: 1.25rem !important;
  }
  .quick-action-btn .btn-label {
    font-size: 0.62rem !important;
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    text-align: center !important;
    white-space: nowrap !important;
  }

  /* Hamburger Menu Icon style */
  .hamburger-menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 12px;
    position: relative;
  }
  .hamburger-menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .bottom-nav-item.active .hamburger-menu-icon span {
    background-color: var(--primary);
  }
  body.drawer-open .hamburger-menu-icon span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
    background-color: var(--primary);
  }
  body.drawer-open .hamburger-menu-icon span:nth-child(2) {
    opacity: 0;
  }
  body.drawer-open .hamburger-menu-icon span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
    background-color: var(--primary);
  }

  /* Settings Grid stacked layout */
  .settings-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  /* Mobile Accordion Style for Settings Cards in Drawer */
  .settings-grid .settings-card {
    cursor: pointer;
    position: relative;
    padding: 16px 18px !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 16px !important;
    overflow: hidden;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    margin-bottom: 12px !important;
    box-shadow: var(--shadow-sm) !important;
    -webkit-tap-highlight-color: transparent;
  }

  .settings-grid .settings-card:hover {
    border-color: rgba(14, 165, 233, 0.25) !important;
    background: var(--bg-card-solid) !important;
  }

  .settings-grid .settings-card:active {
    transform: scale(0.985) !important;
  }
  
  .settings-grid .settings-card h2 {
    margin: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: var(--text-primary) !important;
    user-select: none;
  }
  
  .settings-grid .settings-card h2::after {
    content: '❯';
    font-size: 0.72rem;
    font-weight: 900;
    color: var(--primary);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  /* Hide children except h2 when card is collapsed */
  .settings-grid .settings-card:not(.drawer-expanded) > *:not(h2) {
    display: none !important;
  }
  
  /* Expanded state styling */
  .settings-grid .settings-card.drawer-expanded h2::after {
    content: '❯';
    transform: rotate(90deg);
    color: var(--text-tertiary);
  }

  .settings-grid .settings-card.drawer-expanded h2 {
    border-bottom: 1px solid var(--border-color) !important;
    padding-bottom: 12px !important;
    margin-bottom: 16px !important;
  }
  
  .settings-grid .settings-card.drawer-expanded {
    padding: 18px 20px 22px 20px !important;
    background: var(--bg-card-solid) !important;
    border-color: rgba(14, 165, 233, 0.3) !important;
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.06) !important;
  }

  .settings-grid .settings-card.drawer-expanded > *:not(h2) {
    margin-top: 14px;
    animation: accordionSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes accordionSlideIn {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Desktop: Hide mobile-only components */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

/* Small phones (< 480px) */
@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .txn-stats-row {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 16px 12px 90px;
  }
}


/* Income/Expense Toggle */
.type-toggle-group {
  display: flex;
  background: var(--bg-main);
  border-radius: var(--radius-full);
  padding: 4px;
  border: 1px solid var(--border-color);
}
.type-toggle-group input[type="radio"] {
  display: none;
}
.type-toggle-btn {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
#typeExpense:checked ~ .type-expense {
  background: var(--danger);
  color: white;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}
#typeIncome:checked ~ .type-income {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* File Upload */
.file-upload-wrap {
  position: relative;
}
.file-input {
  display: none;
}
.file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  background: var(--bg-main);
  transition: var(--transition);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-label:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}
.file-icon {
  font-size: 1.25rem;
}

.calc-btn {
  height: 48px;
  font-size: 1.2rem;
  font-weight: 700;
  border-radius: 12px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  touch-action: manipulation;
}

.calc-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.15);
}

.calc-btn:active {
  transform: scale(0.92) !important;
  transition: all 0.05s ease !important;
}

/* Header Calculator Button */
.header-calc-btn {
  background: var(--primary-light);
  border: 1px solid var(--primary-light);
  color: var(--primary);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.header-calc-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

@media (max-width: 768px) {
  .header-calc-btn {
    display: none !important;
  }
}

/* =====================================================
   SaaS Upgrade & Pricing Modal Responsiveness
   ===================================================== */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  text-align: left;
  margin-bottom: 32px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  align-items: stretch;
}

.pricing-card {
  border: 1px solid var(--border-color);
  padding: 20px 16px;
  border-radius: 16px;
  background: var(--bg-card-solid);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.pricing-card.popular {
  border: 2px solid var(--primary);
  position: relative;
  box-shadow: var(--shadow-md);
  transform: scale(1.03);
}

@media (max-width: 600px) {
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  .pricing-card.popular {
    transform: none !important;
    margin: 10px 0;
  }
  .benefits-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  .upgrade-modal-card {
    padding: 24px 16px !important;
  }
}

/* =====================================================
   Premium App Onboarding Tour Overlay Styles
   ===================================================== */
.tour-overlay-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 99990;
  pointer-events: auto; /* Blocks clicking on the page */
  transition: opacity 0.3s ease;
}

.tour-spotlight-box {
  position: fixed;
  z-index: 99995;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.75);
  border: 3px solid var(--primary);
  border-radius: 12px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: tour-spotlight-glow 1.5s infinite alternate;
}

@keyframes tour-spotlight-glow {
  0% {
    border-color: var(--primary);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.75), 0 0 10px rgba(99, 102, 241, 0.6);
  }
  100% {
    border-color: var(--secondary);
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.75), 0 0 20px rgba(16, 185, 129, 0.8);
  }
}

.tour-card-box {
  position: fixed;
  z-index: 99999;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 20px;
  box-sizing: border-box;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

[data-theme="dark"] .tour-card-box {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tour-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-step-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .tour-step-badge {
  background: rgba(99, 102, 241, 0.15);
}

.tour-close-x {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: var(--transition);
}

.tour-close-x:hover {
  color: var(--danger);
}

.tour-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  font-family: var(--font-heading);
}

.tour-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.tour-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.tour-btn-skip {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.tour-btn-next {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

/* Pulsing alert highlight class for clear filter button */
.pulse-glow-danger {
  animation: pulse-danger-border 1.5s infinite alternate;
}

@keyframes pulse-danger-border {
  0% {
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.15);
  }
  100% {
    border-color: rgba(239, 68, 68, 0.8);
    box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.25);
  }
}

/* Pulsing active primary call-to-action */
.pulse-glow-primary {
  animation: pulse-primary-border 1.5s infinite alternate;
}

@keyframes pulse-primary-border {
  0% {
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2), 0 0 0 0 rgba(99, 102, 241, 0.2);
  }
  100% {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4), 0 0 10px 2px rgba(99, 102, 241, 0.3);
  }
}

/* PWA & Soft Paywall Visual Styling */
.txn-masked {
  filter: blur(4.5px) grayscale(30%);
  opacity: 0.35;
  pointer-events: none !important;
  user-select: none !important;
}

.history-lock-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px dashed var(--border-color);
  border-radius: 20px;
  margin-top: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.history-lock-overlay:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Transaction Dot Menu Dropdown */
.txn-actions {
  display: flex;
  gap: 8px;
  opacity: 1 !important; /* Keep visible on mobile! */
}

.txn-menu-container {
  position: relative;
  display: inline-block;
}

.txn-menu-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-full);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.txn-menu-btn:hover {
  background: var(--glass-bg);
  color: var(--text-primary);
}

.txn-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 36px;
  background: var(--bg-card-solid);
  border: 1.5px solid rgba(14, 165, 233, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15);
  z-index: 1000;
  min-width: 150px;
  overflow: hidden;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="dark"] .txn-menu-dropdown {
  background: #0d1632;
  border-color: rgba(56, 189, 248, 0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

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

.txn-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  transition: var(--transition);
  box-sizing: border-box;
}

.txn-menu-item:not(:last-child) {
  border-bottom: 1.5px solid rgba(14, 165, 233, 0.08);
}

.txn-menu-item:hover {
  background: var(--glass-bg);
}

.txn-menu-item.delete-item {
  color: var(--danger);
}

.txn-menu-item.delete-item:hover {
  background: rgba(239, 68, 68, 0.08);
}

/* Redesigned Premium Sidebar User Profile Card */
.sidebar-profile-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.sidebar-profile-card:hover {
  background: rgba(99, 102, 241, 0.06) !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.sidebar-profile-card:hover div:last-child {
  transform: rotate(45deg) scale(1.1);
  color: var(--primary) !important;
  opacity: 1 !important;
}

.sidebar-profile-card.active {
  background: linear-gradient(135deg, var(--primary-light), rgba(99, 102, 241, 0.03)) !important;
  border-color: rgba(99, 102, 241, 0.35) !important;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.15), var(--shadow-sm);
}

/* Redesigned Tabbed Settings Layout (Desktop Only) */
@media (min-width: 769px) {
  .settings-container {
    display: grid !important;
    grid-template-columns: 240px 1fr !important;
    gap: 32px !important;
    align-items: start !important;
    margin-top: 24px !important;
  }
  
  .settings-nav-desktop {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    padding: 16px !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
  }
  
  .settings-tab-btn {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    border-radius: var(--radius-md) !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    font-size: 0.88rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: all 0.2s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  .settings-tab-btn:hover {
    background: var(--glass-bg) !important;
    color: var(--text-primary) !important;
  }
  
  .settings-tab-btn.active {
    background: linear-gradient(135deg, var(--primary-light), rgba(99, 102, 241, 0.04)) !important;
    color: var(--primary) !important;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.2), var(--shadow-sm) !important;
  }
  
  .settings-content-desktop {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }
  
  .settings-pane {
    display: none !important;
    flex-direction: column !important;
    gap: 24px !important;
  }
  
  .settings-pane.active {
    display: flex !important;
    animation: settingsFadeIn 0.3s ease-out !important;
  }
  
  /* Reset masonry style on desktop setting grid */
  .settings-grid {
    column-count: unset !important;
    display: block !important;
  }
}

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

/* Mobile setting defaults */
@media (max-width: 768px) {
  .settings-container {
    display: block !important;
  }
  
  .settings-nav-desktop {
    display: none !important;
  }
  
  .settings-pane {
    display: contents !important;
  }
}


/* Fullscreen Offline Blocking Screen Styles */
#offlineBlockScreen {
  transition: all 0.3s ease;
}

#offlineBlockScreen.active {
  display: flex !important;
  animation: fadeInOffline 0.4s ease-out forwards;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

@keyframes fadeInOffline {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse-danger-border {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.3);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    border-color: rgba(239, 68, 68, 0.8);
  }
}

/* Mobile-only and Desktop-only helpers */
@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  /* Responsive header title & inline logo layout */
  .page-title {
    font-size: 1.35rem !important;
    letter-spacing: -0.3px !important;
    line-height: 1.25 !important;
  }

  .header-brand-logo {
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
  }

  /* Keep Home page header side-by-side */
  #page-home .page-header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 12px !important;
  }

  /* Stack sub-page headers vertically on mobile to prevent cutoffs */
  #page-transactions .page-header,
  #page-reports .page-header,
  #page-budget .page-header,
  #page-goals .page-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding: 24px 20px 28px 20px !important;
  }

  /* Horizontal scrollable action bar for buttons on mobile */
  .header-actions-wrapper {
    width: 100% !important;
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    overflow-x: auto !important;
    padding-bottom: 6px !important;
    margin-bottom: -6px !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .header-actions-wrapper::-webkit-scrollbar {
    display: none !important;
  }
}

/* Mobile Header Brand Logo (subtle inline logo next to page title) */
.header-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  object-fit: cover;
  flex-shrink: 0;
}

/* Premium Profile Avatar Redesign */
.premium-avatar-container {
  position: relative;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.premium-avatar-container:active {
  transform: scale(0.92);
}

.avatar-image-wrapper {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background: var(--bg-card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Premium Pro Glow & Borders */
.premium-avatar-container.is-pro .avatar-image-wrapper {
  border: 2px solid #fbbf24 !important;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.55), inset 0 0 4px rgba(251, 191, 36, 0.3) !important;
  animation: pro-glow-pulse 2s infinite alternate;
}

@keyframes pro-glow-pulse {
  0% {
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
  }
  100% {
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.75);
  }
}

.avatar-status-badge {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--success); /* Green for Active/Online */
  border: 2px solid #7c3aed; /* Matches the parent background context */
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  z-index: 5;
}

/* Match status badge border in different container backgrounds */
.sidebar-profile-card .avatar-status-badge {
  border-color: #0b132b !important; /* Matches dark sidebar footer background */
}
[data-theme="standard"] .sidebar-profile-card .avatar-status-badge,
body:not([data-theme="dark"]) .sidebar-profile-card .avatar-status-badge {
  border-color: #ffffff !important; /* Matches light sidebar background */
}

/* Pro Status Badge style */
.premium-avatar-container.is-pro .avatar-status-badge {
  background-color: #fbbf24 !important; /* Gold */
}
