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

:root {
  /* Modern Color Palette */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --success: #10b981;
  --success-light: #34d399;
  --danger: #ef4444;
  --danger-light: #f87171;
  --warning: #f59e0b;
  --warning-light: #fbbf24;
  --info: #0ea5e9;
  
  /* Backgrounds */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.8);
  
  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* Borders & Shadows */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --shadow-colored: 0 4px 14px rgba(99, 102, 241, 0.25);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
  --transition-bounce: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
}

/* Dark Mode */
[data-theme="dark"] {
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --success: #34d399;
  --success-light: #6ee7b7;
  --danger: #f87171;
  --danger-light: #fca5a5;
  --warning: #fbbf24;
  --warning-light: #fcd34d;
  
  --bg-primary: #1e293b;
  --bg-secondary: #0f172a;
  --bg-tertiary: #334155;
  --bg-glass: rgba(30, 41, 59, 0.9);
  
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border: #334155;
  --border-light: #1e293b;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(129, 140, 248, 0.2);
  --shadow-colored: 0 4px 14px rgba(129, 140, 248, 0.3);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: text;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Header - Glassmorphism */
.header {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: visible;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  position: relative;
  overflow: visible;
}

.user-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
}

/* Navigation - Pill Style */
.nav {
  background: var(--bg-primary);
  padding: 0.75rem 2rem;
  display: flex;
  gap: 0.375rem;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100vw;
  box-sizing: border-box;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  padding: 0.625rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
}

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

.nav-btn.active {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-colored);
}

/* Main Content */
.main {
  flex: 1;
  padding: 1.5rem 2rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Analytics section - maximize width even more */
#analytics-section {
  max-width: 100%;
}

#analytics-section .main {
  max-width: 100%;
  padding: 1.5rem;
}

.section {
  display: none;
  overflow-x: hidden;
  max-width: 100%;
  padding-bottom: 100px;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease;
}

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

.section.active {
  display: block;
}

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

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* Buttons - Modern Style */
.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-base);
  font-weight: 600;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::before {
  opacity: 1;
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-colored);
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg), var(--shadow-colored);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.97) translateY(0);
}

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

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.btn-icon {
  padding: 0.5rem;
  font-size: 1.1rem;
  min-width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem;
}

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

/* Cards - Elevated Style */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

/* Stats Grid - Modern Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-primary);
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.stat-card:hover::before {
  opacity: 1;
}

.stat-icon {
  font-size: 2.25rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.stat-icon.income-icon {
  background: rgba(16, 185, 129, 0.1);
}

.stat-icon.expense-icon {
  background: rgba(239, 68, 68, 0.1);
}

.stat-icon.balance-icon {
  background: rgba(99, 102, 241, 0.1);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-value.income {
  color: var(--success);
}

.stat-value.expense {
  color: var(--danger);
}

/* Dashboard */
.dashboard-actions {
  display: flex;
  gap: 0.75rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.dashboard-widget {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
  grid-column: span 4;
  min-width: 0;
}

.dashboard-widget:hover {
  box-shadow: var(--shadow-md);
}

.dashboard-widget.large {
  grid-column: span 8;
}

.dashboard-widget.full {
  grid-column: span 12;
}

.dashboard-widget.half {
  grid-column: span 6;
}

@media (max-width: 1200px) {
  .dashboard-widget {
    grid-column: span 6;
  }
  .dashboard-widget.large {
    grid-column: span 12;
  }
  .dashboard-widget.full {
    grid-column: span 12;
  }
  .dashboard-widget.half {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .dashboard-widget,
  .dashboard-widget.large,
  .dashboard-widget.full,
  .dashboard-widget.half {
    grid-column: span 1;
  }
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.widget-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-link:hover {
  background: var(--bg-secondary);
}

.widget-content {
  max-height: 350px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for widget content */
.widget-content::-webkit-scrollbar {
  width: 6px;
}

.widget-content::-webkit-scrollbar-track {
  background: transparent;
}

.widget-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.widget-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.category-list, .budget-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.category-item, .budget-item {
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-fast);
  min-width: 0;
  overflow: hidden;
}

.category-item > *, .budget-item > * {
  min-width: 0;
  flex: 1;
}

.category-item:hover, .budget-item:hover {
  background: var(--bg-tertiary);
}

/* Dashboard Account Items */
.account-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: 0.625rem;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

.account-summary-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
  transform: translateX(2px);
}

.account-summary-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.account-type-badge {
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.account-summary-details {
  min-width: 0;
  overflow: hidden;
}

.account-summary-details h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-summary-details p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-summary-balance {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  margin-left: 0.75rem;
}

/* Dashboard Transaction Items */
.transaction-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  border-radius: var(--radius-md);
  margin: 0 -0.5rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

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

.transaction-list-item:hover {
  background: var(--bg-secondary);
}

.transaction-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.transaction-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.transaction-details {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.transaction-details h4 {
  margin: 0 0 0.125rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-details p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-amount {
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.transaction-amount.income {
  color: var(--success);
}

.transaction-amount.expense {
  color: var(--danger);
}

/* Dashboard Category Items */
.category-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

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

.category-summary-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.category-color-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.category-summary-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.category-summary-amount {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-secondary);
}

.empty-state p {
  margin: 0.75rem 0 0 0;
  font-size: 0.9rem;
}

.category-name, .budget-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.category-color {
  width: 1rem;
  height: 1rem;
  border-radius: var(--radius-sm);
}

.category-amount, .budget-amount {
  font-weight: 600;
}

.budget-progress-bar {
  width: 100%;
  height: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  margin-top: 0.5rem;
  overflow: hidden;
}

.budget-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  transition: width var(--transition-slow);
  border-radius: var(--radius-full);
}

.budget-progress-fill.warning {
  background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.budget-progress-fill.danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--bg-secondary);
}

.table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  padding: 1rem;
  border-top: 1px solid var(--border-light);
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--bg-secondary);
}

.amount-income {
  color: var(--success);
  font-weight: 600;
}

.amount-expense {
  color: var(--danger);
  font-weight: 600;
}

/* Grids */
.budgets-grid, .cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.budget-card, .credit-card, .account-card {
  background: var(--bg-primary);
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  position: relative;
  transition: all var(--transition-base);
  min-height: fit-content;
}

.account-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.budget-card h4, .credit-card h4, .account-card h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.budget-details, .card-details, .account-details {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.detail-label {
  color: var(--text-secondary);
}

.detail-value {
  font-weight: 600;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
  flex-wrap: wrap;
  max-width: 100%;
}

/* Action Menu Button */
.action-menu-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

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

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

.action-menu {
  position: fixed;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 160px;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95) translateY(-4px);
  transition: all var(--transition-fast);
}

.action-menu.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1) translateY(0);
}

.action-menu-item {
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.action-menu-item:hover {
  background: var(--bg-secondary);
  padding-left: 1.25rem;
}

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

.action-menu-item.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Filters */
.date-filter, .filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.date-filter input, .filters input, .filters select {
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.date-filter input:focus, .filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: modalFadeIn 0.2s ease;
}

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

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  justify-content: flex-start;
  margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
  width: auto !important;
  margin: 0;
  accent-color: var(--primary);
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.25s ease;
}

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

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

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.close-btn {
  background: var(--bg-secondary);
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

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

/* Form */
form {
  padding: 1.5rem;
}

/* Modal body padding for non-form content */
.modal-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* Empty State - Enhanced */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 2px dashed var(--border);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.6;
  display: block;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.empty-state .btn {
  margin-top: 0.5rem;
}

/* Responsive - Large Screens */
@media (min-width: 1600px) {
  .main {
    max-width: 100%;
    padding: 2rem 3rem;
  }

  #analytics-section .settings-container {
    gap: 0.5rem;
  }

  #analytics-section .settings-card {
    padding: 1rem;
  }
}

@media (min-width: 1920px) {
  .main {
    padding: 2rem 4rem;
  }

  #analytics-section {
    padding: 0 2rem;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 0.875rem 1rem;
  }

  .header h1 {
    font-size: 1.25rem;
  }

  .nav {
    padding: 0.5rem 1rem;
  }

  .main {
    padding: 1rem;
  }

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

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .table {
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 0.625rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.75rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* Category Tabs */
.category-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}

.category-tab {
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-weight: 500;
}

.category-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.category-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Categories Grid */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  overflow: visible;
}

.category-card {
  background: var(--bg-primary);
  padding: 1.25rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  position: relative;
  z-index: 1;
  overflow: visible;
  transition: all var(--transition-base);
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

.category-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-color-box {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.category-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.subcategory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.subcategory-tag {
  background: var(--bg-secondary);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: all var(--transition-fast);
}

.subcategory-tag:hover {
  background: var(--bg-tertiary);
}

.subcategory-tag button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.subcategory-tag button:hover {
  color: var(--danger);
}

.subcategory-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 200px;
  overflow-y: auto;
}

.subcategory-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.subcategory-item button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

/* Icon Picker */
.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  max-height: 200px;
  overflow-y: auto;
}

.icon-option {
  font-size: 1.5rem;
  padding: 0.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  background: var(--bg-primary);
}

.icon-option:hover {
  background: var(--bg-tertiary);
  transform: scale(1.1);
}

.icon-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.05);
}

/* CSV Import */
.csv-preview-table {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.csv-preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.csv-preview-table th,
.csv-preview-table td {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-light);
  text-align: left;
}

.csv-preview-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  position: sticky;
  top: 0;
  font-size: 0.8rem;
}

.csv-column-select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: 0.85rem;
}

/* Settings */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 100%;
  width: 100%;
}

/* Limit width only for settings page, not analytics */
#settings-section .settings-container {
  max-width: 800px;
}

.settings-card {
  background: var(--bg-primary);
  padding: 1.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

.settings-card:hover {
  box-shadow: var(--shadow-md);
}

/* Analytics specific - maximize width */
#analytics-section .settings-container {
  max-width: 100%;
  gap: 0.75rem;
}

#analytics-section .settings-card {
  padding: 1.25rem;
}

.settings-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.settings-card .form-group {
  margin-bottom: 0;
}

/* Mobile/Desktop View Toggles */
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  #transactions-section .card {
    display: none;
  }
}

/* ============= HAMBURGER MENU & SIDEBAR ============= */

/* Hamburger Button - Hidden on desktop */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1000;
}

.hamburger-btn span {
  width: 100%;
  height: 2.5px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.hamburger-btn.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Sidebar - Hidden on desktop */
.sidebar {
  display: none;
}

.sidebar-overlay {
  display: none;
}

/* ============= MOBILE RESPONSIVE ============= */

/* Touch feedback improvements */
@media (hover: none) and (pointer: coarse) {
  button, .btn, .nav-btn, .card, .budget-card, .account-card, .category-card {
    -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
    touch-action: manipulation;
    cursor: pointer;
  }

  button:active, .btn:active, .nav-btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .card:active, .budget-card:active, .account-card:active, .category-card:active {
    transform: scale(0.99);
    transition: transform 0.1s ease;
  }

  /* Smooth scrolling */
  * {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

@media (max-width: 768px) {
  /* Hamburger Menu - Hidden on mobile, use FAB instead */
  .hamburger-btn {
    display: none;
  }

  /* Sidebar Overlay */
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Sidebar */
  .sidebar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform var(--transition-slow);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .sidebar-header {
    padding: 1.5rem 1rem;
    background: var(--primary-gradient);
    color: white;
  }

  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .user-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
  }

  .user-details {
    flex: 1;
  }

  .sidebar-user-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
  }

  .btn-logout {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
  }

  .btn-logout:active {
    background: rgba(255, 255, 255, 0.3);
  }

  .sidebar-nav {
    padding: 1rem 0;
  }

  .sidebar-nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    text-align: left;
    border-left: 3px solid transparent;
  }

  .sidebar-nav-btn:active {
    background: var(--bg-secondary);
  }

  .sidebar-nav-btn.active {
    background: var(--bg-secondary);
    color: var(--primary);
    border-left-color: var(--primary);
  }

  .nav-icon {
    font-size: 1.25rem;
    min-width: 24px;
    display: inline-block;
  }

  /* Header */
  .header {
    padding: 1rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .header h1 {
    font-size: 1.25rem;
    margin: 0;
  }

  .header-actions {
    display: none;
  }

  /* Hide desktop navigation on mobile */
  .nav {
    display: none;
  }

  /* Main Content */
  .main {
    padding: 1rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5rem);
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* All sections */
  .section {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* All widgets and cards */
  .dashboard-widget,
  .stat-card,
  .budget-card,
  .account-card,
  .category-card {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  /* Stats Grid - 2 columns on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  /* Dashboard Grid - single column */
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dashboard-widget,
  .dashboard-widget.large,
  .dashboard-widget.half,
  .dashboard-widget.full {
    grid-column: span 1;
  }

  .widget-content {
    max-height: 280px;
  }

  /* Hide buttons on mobile (use FAB instead) */
  .mobile-hide {
    display: none !important;
  }

  /* Modal */
  .modal {
    align-items: flex-end;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    margin: 0;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    border-radius: 1.5rem 1.5rem 0 0;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .modal.active {
    animation: modalFadeIn 0.2s ease;
  }

  @keyframes slideUp {
    0% {
      transform: translateY(100%) scale(0.95);
      opacity: 0;
    }
    100% {
      transform: translateY(0) scale(1);
      opacity: 1;
    }
  }

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

  .modal-header {
    padding: 1.25rem;
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
    border-bottom: 2px solid var(--border);
  }

  .modal-header h3 {
    font-size: 1.35rem;
    font-weight: 700;
  }

  .close-btn {
    font-size: 2rem;
    width: 36px;
    height: 36px;
  }

  .modal-body {
    padding: 1.5rem 1rem;
  }

  /* Modal transaction cards on mobile */
  #budget-detail-content .transaction-card,
  #account-detail-content .transaction-card {
    padding: 0.875rem;
    margin-bottom: 0.5rem;
  }

  #budget-detail-content .transaction-card > div,
  #account-detail-content .transaction-card > div {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.5rem;
  }

  #budget-detail-content .transaction-card > div > div:last-child,
  #account-detail-content .transaction-card > div > div:last-child {
    text-align: right;
  }

  /* Forms */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.875rem;
    font-size: 1rem;
    border-radius: 0.5rem;
  }

  /* Fix date input overflow on mobile */
  .form-group input[type="date"] {
    max-width: 100%;
    min-width: 0;
    font-size: 0.95rem;
    padding: 0.875rem 0.5rem;
    box-sizing: border-box;
    width: 100%;
  }

  .form-group input[type="date"]::-webkit-calendar-picker-indicator {
    margin-left: 0;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
  }

  .form-actions button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
  }

  .form-actions .btn-primary {
    grid-column: 1 / -1;
    order: -1;
  }

  /* Tables */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: calc(100vw - 2rem);
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .data-table {
    font-size: 0.875rem;
    min-width: 600px;
  }

  .data-table th,
  .data-table td {
    padding: 0.75rem 0.5rem;
    min-height: 44px;
  }

  .data-table th {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 1;
  }

  /* Cards */
  .budget-card,
  .account-card,
  .category-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  /* Transaction Cards for Mobile */
  .transaction-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 100%;
    overflow: hidden;
  }

  .transaction-card:active {
    transform: scale(0.98);
    background: var(--background);
  }

  .transaction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
  }

  .transaction-card-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
  }

  .transaction-card-amount {
    font-size: 1.125rem;
    font-weight: 700;
  }

  .transaction-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .transaction-card-desc {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .transaction-card-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .budget-card:active,
  .account-card:active,
  .category-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .budget-card h4,
  .account-card h4,
  .category-card h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .detail-row {
    padding: 0.75rem 0;
  }

  .detail-label {
    font-size: 0.875rem;
  }

  .detail-value {
    font-size: 1rem;
    font-weight: 600;
  }

  /* Budget Detail Modal */
  #budget-detail-content > div:first-child > div:first-child {
    grid-template-columns: 1fr !important;
  }

  /* Account Detail Modal */
  #account-detail-content > div:first-child > div:first-child {
    grid-template-columns: 1fr !important;
  }

  /* Analytics Grid */
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  /* Period Filter */
  .period-filter {
    width: 100%;
  }

  .period-filter select {
    width: 100%;
  }

  /* Buttons */
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    min-height: 44px;
    font-weight: 500;
  }

  /* Larger touch targets for action buttons */
  .card-actions button {
    min-height: 44px;
    padding: 0.75rem 1rem;
  }

  /* Dashboard Widgets */
  .dashboard-widget {
    padding: 1.25rem;
  }

  .dashboard-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 700;
  }

  .dashboard-accounts .account-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .budget-item,
  .category-summary-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  .transaction-item {
    padding: 1rem;
  }

  /* Transaction Form - Stack transfer accounts on mobile */
  .form-row {
    flex-direction: column;
  }

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

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.35rem;
  }

  .stat-card h3 {
    font-size: 1.5rem;
  }

  .stat-card p {
    font-size: 0.8rem;
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .card-actions button {
    width: 100%;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }

  /* Make tables scrollable on very small screens */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .data-table {
    min-width: 500px;
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem 0.375rem;
  }

  /* Add bottom padding for mobile navigation */
  .main {
    padding-bottom: 2rem;
  }
}

/* PWA Standalone Mode */
@media (display-mode: standalone) {
  .header {
    padding-top: env(safe-area-inset-top);
  }

  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
  .header {
    padding-top: max(1.5rem, env(safe-area-inset-top));
  }

  .main {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

/* Transaction Controls Bar */
.transaction-controls {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 150px;
}

.control-group.search-group {
  flex: 1;
  min-width: 200px;
}

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

.control-select,
.control-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--bg-primary);
  transition: all 0.2s;
}

.control-select:focus,
.control-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#custom-date-range {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

#custom-date-range label {
  font-size: 0.85rem;
  margin-bottom: 0;
}

#custom-date-range input {
  max-width: 150px;
}

.btn-filter {
  padding: 0.625rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-end;
}

.btn-filter:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
}

.btn-filter.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-badge {
  background: var(--danger);
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.filter-badge:empty {
  display: none;
}

/* Advanced Filters */
.advanced-filters {
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  margin-bottom: 1rem;
  animation: slideDown 0.2s ease;
}

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

/* Transaction Stats */
.transaction-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stats-toggle {
  display: none;
}

.stats-detail {
  display: contents;
}

.stat-item {
  background: var(--bg-primary);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-item.income {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
  border-left: 3px solid var(--success);
}

.stat-item.expense {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-left: 3px solid var(--danger);
}

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

.stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-item.income .stat-number {
  color: var(--success);
}

.stat-item.expense .stat-number {
  color: var(--danger);
}

/* Actions Dropdown */
.btn-group {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  min-width: 160px;
  z-index: 1000;
  display: none;
}

.dropdown-menu.show {
  display: block;
  animation: fadeIn 0.15s ease;
}

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

.dropdown-menu button {
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: background 0.2s;
}

.dropdown-menu button:hover {
  background: var(--bg-tertiary);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .transaction-controls {
    padding: 0.625rem 0.75rem;
    gap: 0.625rem;
  }
  
  .control-group label {
    font-size: 0.75rem;
  }
  
  .control-select,
  .control-input {
    padding: 0.5rem 0.625rem;
    font-size: 0.9rem;
  }
  
  .control-group {
    width: 100%;
  }
  
  .control-group:first-child {
    order: 1;
  }
  
  .search-group {
    order: 2;
    width: 100%;
  }
  
  .btn-filter {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
  }
  
  #custom-date-range {
    order: 4;
    width: 100%;
  }
  
  #custom-date-range input {
    max-width: 100%;
  }
  
  .transaction-stats {
    display: block;
    background: var(--bg-primary);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
  }
  
  .stats-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s;
  }
  
  .stats-toggle:active {
    background: var(--bg-tertiary);
  }
  
  .stats-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
  }
  
  .stats-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }
  
  .stats-summary-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
  
  .stats-summary-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .stats-expand-icon {
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: transform 0.3s;
    flex-shrink: 0;
  }
  
  .stats-toggle.expanded .stats-expand-icon {
    transform: rotate(180deg);
  }
  
  .stats-detail {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    padding: 0 0.625rem 0.625rem 0.625rem;
  }
  
  .stats-detail.show {
    display: grid;
    animation: slideDown 0.2s ease;
  }
  
  .stat-item {
    padding: 0.625rem;
    background: var(--bg-tertiary);
    box-shadow: none;
    border: none;
    border-left: none !important;
  }
  
  .stat-item.income,
  .stat-item.expense {
    background: var(--bg-tertiary);
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .stat-number {
    font-size: 1rem;
  }
  
  .stat-item.income .stat-number {
    color: var(--success);
  }
  
  .stat-item.expense .stat-number {
    color: var(--danger);
  }
  
  .advanced-filters {
    padding: 0.75rem;
  }
  
  .stat-label {
    font-size: 0.7rem;
    margin: 0;
  }
  
  .stat-number {
    font-size: 1rem;
    font-weight: 700;
  }
  
  .advanced-filters {
    padding: 0.75rem;
  }
  
  .filter-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .filter-group {
    width: 100%;
  }
  
  /* Mobile card view improvements */
  .card {
    border-radius: 8px;
    overflow: hidden;
  }
  
  .table {
    display: none;
  }
  
  #transactions-mobile {
    display: block !important;
  }
  
  /* Better mobile action buttons */
  .section-header .filters {
    gap: 0.5rem;
  }
  
  .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 180px;
  }
}

/* Mobile Transaction Cards Enhancement */
@media (max-width: 768px) {
  .transaction-card {
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 0.625rem;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--border);
    transition: all 0.2s;
  }
  
  .transaction-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
  }
  
  .transaction-card.income {
    border-left-color: var(--success);
  }
  
  .transaction-card.expense {
    border-left-color: var(--danger);
  }
  
  .transaction-card.transfer {
    border-left-color: var(--primary);
  }
  
  .transaction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
  }
  
  .transaction-card-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
  }
  
  .transaction-card-amount {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    margin-left: 1rem;
  }
  
  .transaction-card-amount.income {
    color: var(--success);
  }
  
  .transaction-card-amount.expense {
    color: var(--danger);
  }
  
  .transaction-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
  }
  
  .transaction-card-detail {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  
  .transaction-card-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 0.5rem;
  }
}

/* Desktop - hide mobile cards */
@media (min-width: 769px) {
  #transactions-mobile {
    display: none;
  }
  
  .accounts-mobile {
    display: none;
  }
}

/* ============= ACCOUNT SUMMARY STATS ============= */
.account-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.account-stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
}

.stat-details {
  flex: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ============= MOBILE ACCOUNT CARDS ============= */
.accounts-mobile {
  display: none;
}

.account-mobile-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.account-mobile-card:active {
  transform: scale(0.98);
  background: var(--bg-secondary);
}

.account-mobile-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.account-mobile-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  flex-shrink: 0;
}

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

.account-mobile-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mobile-type {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.account-mobile-balance {
  text-align: right;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.account-mobile-balance.credit {
  color: var(--primary);
}

.account-mobile-balance.positive {
  color: var(--success);
}

.balance-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.account-mobile-progress {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.account-badge {
  margin-top: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--warning);
  color: white;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  display: inline-block;
}

@media (max-width: 768px) {
  .accounts-mobile {
    display: block;
  }
  
  .accounts-desktop {
    display: none;
  }
  
  .account-summary-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .account-stat-card {
    padding: 0.625rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .stat-icon {
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
  }
  
  .stat-label {
    font-size: 0.7rem;
  }
  
  .stat-value {
    font-size: 0.95rem;
  }
}

/* Filter Container */
.filter-container {
  margin-bottom: 1rem;
}

.filter-toggle-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.filter-toggle-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
}

.filter-toggle-btn span:first-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-count {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.filter-count:empty {
  display: none;
}

.filter-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-top: -1px;
}

.filter-panel.open {
  max-height: 500px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.filter-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-group {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-group input,
.filter-group select {
  padding: 0.625rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  width: 100%;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Mobile Responsive Filters */
@media (max-width: 768px) {
  .date-presets {
    padding: 0.5rem;
  }
  
  .preset-btn {
    min-width: calc(50% - 0.25rem);
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
  
  .filter-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .filter-group {
    min-width: 100%;
  }
}

/* Goals Grid */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  padding: 0 1rem;
}

.goal-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Bills Container */
.bills-container {
  padding: 0 1rem;
}

.bills-filters button.active {
  background: var(--primary);
  color: white;
}

.bill-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Budget Alert Backgrounds */
[data-theme="dark"] .budget-alert-item {
  background: rgba(239, 68, 68, 0.1) !important;
}

[data-theme="dark"] .budget-alert-item[style*="warning"] {
  background: rgba(245, 158, 11, 0.1) !important;
}

/* Primary Light Color for Tags */
:root {
  --primary-light: #e0e7ff;
}

[data-theme="dark"] {
  --primary-light: #3b4a6b;
}

/* Danger Background for overdue bills */
:root {
  --danger-bg: #fef2f2;
  --warning-bg: #fffbeb;
}

[data-theme="dark"] {
  --danger-bg: rgba(239, 68, 68, 0.15);
  --warning-bg: rgba(245, 158, 11, 0.15);
}

/* Small Button Style */
.btn-sm {
  padding: 0.375rem 0.75rem !important;
  font-size: 0.85rem !important;
}

/* Card Background for dark mode */
:root {
  --card-bg: var(--bg-primary);
}

[data-theme="dark"] {
  --card-bg: var(--bg-tertiary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch.small {
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch.small .toggle-slider:before {
  height: 16px;
  width: 16px;
}

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

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-switch.small input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

/* Loading Spinner */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 0.5rem;
}

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

/* Insight Cards */
.insight-card {
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.insight-card.warning {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
}

.insight-card.success {
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--success);
}

.insight-card.info {
  background: var(--bg-secondary);
  border-left: 3px solid var(--primary);
}

.insight-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.insight-content {
  flex: 1;
}

.insight-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.insight-description {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Forecast Widget */
.forecast-stat {
  text-align: center;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.forecast-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.forecast-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.forecast-progress {
  margin-top: 1rem;
}

.forecast-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.forecast-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Offline Banner */
.offline-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warning);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 1000;
  display: none;
  box-shadow: var(--shadow-lg);
}

.offline-banner.show {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Auto-suggest dropdown */
.category-suggestion {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.25rem;
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: none;
}

.category-suggestion.show {
  display: block;
}

.category-suggestion-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.suggestion-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.suggestion-confidence {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
}

/* Toast animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* Calendar View Styles */
.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-secondary);
  padding: 0.25rem;
  border-radius: 8px;
}

.view-toggle-btn {
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.view-toggle-btn.active {
  background: var(--bg-primary);
  box-shadow: var(--shadow);
}

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

.calendar-nav {
  display: flex;
  gap: 0.5rem;
}

.calendar-nav button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-nav button:hover {
  background: var(--bg-secondary);
}

.calendar-grid {
  background: var(--bg-primary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.calendar-weekdays span {
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  min-height: 80px;
  padding: 0.5rem;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-day:hover {
  background: var(--bg-secondary);
}

.calendar-day.other-month {
  opacity: 0.4;
}

.calendar-day.today {
  background: rgba(59, 130, 246, 0.1);
}

.calendar-day.selected {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
}

.calendar-day-number {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.calendar-day-transactions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-transaction {
  font-size: 0.7rem;
  padding: 2px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-transaction.income {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.calendar-transaction.expense {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.calendar-day-total {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: auto;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.calendar-day-detail {
  margin-top: 1rem;
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.calendar-day-detail h4 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Net Worth & Assets Styles */
.asset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.asset-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.asset-icon {
  font-size: 1.5rem;
}

.asset-details h4 {
  font-size: 0.95rem;
  margin-bottom: 0.125rem;
}

.asset-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.asset-value {
  text-align: right;
}

.asset-value .amount {
  font-size: 1.1rem;
  font-weight: 700;
}

.asset-value .change {
  font-size: 0.8rem;
}

.asset-actions {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.asset-actions button {
  padding: 0.25rem 0.5rem;
  border: none;
  background: var(--bg-tertiary);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.asset-actions button:hover {
  background: var(--bg-primary);
}

/* Achievement Badges */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.achievement {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.achievement.locked {
  opacity: 0.5;
  filter: grayscale(1);
}

.achievement.unlocked {
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.achievement-badge {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 50%;
  margin-bottom: 0.5rem;
}

.achievement.locked .achievement-badge {
  background: var(--bg-tertiary);
}

.achievement-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

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

.achievement-progress {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.achievement-progress-bar {
  height: 100%;
  background: var(--warning);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* Gamification Stats */
.streak-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border-radius: 20px;
  font-weight: 600;
}

.streak-flame {
  font-size: 1.2rem;
  animation: flicker 1s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.points-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: white;
  border-radius: 20px;
  font-weight: 600;
}

/* Exchange Rates Table */
.exchange-rates-table {
  width: 100%;
  border-collapse: collapse;
}

.exchange-rates-table th,
.exchange-rates-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.exchange-rates-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.exchange-rates-table tr:hover td {
  background: var(--bg-secondary);
}

.rate-change {
  font-size: 0.8rem;
}

.rate-change.up {
  color: var(--success);
}

.rate-change.down {
  color: var(--danger);
}

/* Import Preview Table */
#import-preview-body tr {
  border-bottom: 1px solid var(--border);
}

#import-preview-body td {
  padding: 0.5rem;
}

#import-preview-body .amount.positive {
  color: var(--success);
}

#import-preview-body .amount.negative {
  color: var(--danger);
}

/* Responsive Calendar */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 60px;
    padding: 0.25rem;
  }
  
  .calendar-day-number {
    font-size: 0.8rem;
  }
  
  .calendar-transaction {
    display: none;
  }
  
  .calendar-day-total {
    font-size: 0.65rem;
  }
  
  .calendar-weekdays span {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }
  
  .achievement-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .achievement-badge {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
  }
}

/* ===============================
   SWIPE GESTURES & TOUCH UX
   =============================== */

/* Swipeable Transaction Item */
.swipeable-container {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.swipe-actions {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  z-index: 1;
}

.swipe-actions-left {
  left: 0;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding-left: 1rem;
}

.swipe-actions-right {
  right: 0;
  background: linear-gradient(90deg, #dc2626 0%, var(--danger) 100%);
  padding-right: 1rem;
}

.swipe-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  gap: 0.25rem;
}

.swipe-action-btn .icon {
  font-size: 1.25rem;
}

.swipeable-content {
  position: relative;
  background: var(--bg-primary);
  z-index: 2;
  transition: transform 0.2s ease-out;
  touch-action: pan-y pinch-zoom;
}

.swipeable-content.swiping {
  transition: none;
}

/* Bottom Sheet Modal */
.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bottom-sheet-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-radius: 24px 24px 0 0;
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bottom-sheet.active {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 36px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  margin: 12px auto;
  flex-shrink: 0;
}

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

.bottom-sheet-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.bottom-sheet-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.5rem;
  line-height: 1;
}

.bottom-sheet-content {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
}

/* Quick Add Form */
.quick-add-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quick-add-amount {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 1rem 1.5rem;
}

.quick-add-amount .currency {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.quick-add-amount input {
  flex: 1;
  font-size: 2rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  width: 100%;
}

.quick-add-type-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 4px;
}

.quick-add-type-toggle button {
  flex: 1;
  padding: 0.75rem;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
}

.quick-add-type-toggle button.active {
  background: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.quick-add-type-toggle button.expense.active {
  color: var(--danger);
}

.quick-add-type-toggle button.income.active {
  color: var(--success);
}

.quick-add-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.quick-add-suggestion {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-add-suggestion:hover,
.quick-add-suggestion.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.quick-add-input {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.quick-add-row {
  display: flex;
  gap: 0.75rem;
}

.quick-add-row > * {
  flex: 1;
}

.quick-add-submit {
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.quick-add-submit:hover {
  background: var(--primary-dark);
}

.quick-add-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Pull to Refresh */
.pull-to-refresh {
  position: absolute;
  top: -60px;
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.pull-to-refresh .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin-right: 0.5rem;
}

.pull-to-refresh.refreshing .spinner {
  animation: spin 0.8s linear infinite;
}

.pull-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--bg-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 12px 12px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease;
}

.pull-indicator.visible {
  transform: translateX(-50%) translateY(0);
}

.pull-indicator.refreshing .pull-arrow {
  animation: spin 0.8s linear infinite;
}

.pull-arrow {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.pull-indicator.ready .pull-arrow {
  transform: rotate(180deg);
}

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

/* Recent Transactions (Favorites/Quick Select) */
.recent-transactions {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.recent-transaction-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.recent-transaction-chip:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}

.recent-transaction-chip .amount {
  font-weight: 600;
}

.recent-transaction-chip .amount.expense {
  color: var(--danger);
}

.recent-transaction-chip .amount.income {
  color: var(--success);
}

/* Undo Toast */
.undo-toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1f2937;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
}

.undo-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.undo-toast button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

/* Enhanced Mobile Transaction Cards */
@media (max-width: 768px) {
  .transaction-card {
    position: relative;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0;
    box-shadow: var(--shadow);
    touch-action: pan-y;
  }
  
  .transaction-card-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .transaction-card .icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    font-size: 1.25rem;
  }
  
  .transaction-card .details {
    flex: 1;
    min-width: 0;
  }
  
  .transaction-card .description {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .transaction-card .meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
  }
  
  .transaction-card .amount {
    font-weight: 700;
    font-size: 1rem;
    text-align: right;
  }
  
  .transaction-card .amount.expense {
    color: var(--danger);
  }
  
  .transaction-card .amount.income {
    color: var(--success);
  }
}

/* Desktop: keep original table but add hover effects */
@media (min-width: 769px) {
  .transactions-table tbody tr {
    transition: background 0.2s ease;
  }
  
  .transactions-table tbody tr:hover {
    background: var(--bg-secondary);
  }
  
  .transactions-table tbody tr .action-btns {
    opacity: 0.5;
    transition: opacity 0.2s ease;
  }
  
  .transactions-table tbody tr:hover .action-btns {
    opacity: 1;
  }
}

/* ===============================
   SKELETON LOADING STATES
   =============================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    var(--bg-tertiary, rgba(0, 0, 0, 0.05)) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-text.medium {
  width: 70%;
}

.skeleton-text.full {
  width: 100%;
}

.skeleton-circle {
  border-radius: 50%;
}

.skeleton-card {
  padding: 1.5rem;
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.skeleton-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skeleton-stat .skeleton-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.skeleton-stat .skeleton-value {
  height: 2rem;
  width: 60%;
}

.skeleton-stat .skeleton-label {
  height: 0.875rem;
  width: 40%;
}

.skeleton-chart {
  height: 200px;
  border-radius: 12px;
}

.skeleton-transaction {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

.skeleton-transaction .skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
}

.skeleton-transaction .skeleton-details {
  flex: 1;
}

.skeleton-transaction .skeleton-amount {
  width: 60px;
  height: 1.5rem;
}

/* ===============================
   SPENDING HEATMAP
   =============================== */
.heatmap-container {
  padding: 1rem;
  overflow-x: auto;
}

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

.heatmap-year-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.heatmap-year-nav button {
  background: var(--bg-secondary);
  border: none;
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.heatmap-year-nav button:hover {
  background: var(--bg-tertiary);
}

.heatmap-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.heatmap-months {
  display: flex;
  padding-left: 30px;
  margin-bottom: 4px;
}

.heatmap-month-label {
  flex: 1;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

.heatmap-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.heatmap-day-label {
  width: 25px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: right;
  padding-right: 5px;
}

.heatmap-weeks {
  display: flex;
  gap: 2px;
}

.heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.heatmap-cell:hover {
  transform: scale(1.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.heatmap-cell[data-intensity="0"] { background: var(--bg-secondary); }
.heatmap-cell[data-intensity="1"] { background: #dcfce7; }
.heatmap-cell[data-intensity="2"] { background: #86efac; }
.heatmap-cell[data-intensity="3"] { background: #22c55e; }
.heatmap-cell[data-intensity="4"] { background: #16a34a; }

/* Expense heatmap uses red tones */
.heatmap-expense .heatmap-cell[data-intensity="1"] { background: #fee2e2; }
.heatmap-expense .heatmap-cell[data-intensity="2"] { background: #fca5a5; }
.heatmap-expense .heatmap-cell[data-intensity="3"] { background: #ef4444; }
.heatmap-expense .heatmap-cell[data-intensity="4"] { background: #dc2626; }

[data-theme="dark"] .heatmap-cell[data-intensity="0"] { background: #374151; }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.heatmap-legend-cells {
  display: flex;
  gap: 2px;
}

.heatmap-tooltip {
  position: fixed;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  pointer-events: none;
}

.heatmap-tooltip strong {
  display: block;
  margin-bottom: 0.25rem;
}

.heatmap-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.heatmap-stat {
  text-align: center;
}

.heatmap-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.heatmap-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ===============================
   ANOMALY ALERTS
   =============================== */
.alerts-bell {
  position: relative;
  cursor: pointer;
}

.alerts-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.alerts-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-height: 400px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 1000;
  display: none;
}

.alerts-dropdown.active {
  display: block;
}

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

.alerts-header h4 {
  margin: 0;
  font-size: 1rem;
}

.alerts-list {
  max-height: 320px;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.alert-item:hover {
  background: var(--bg-secondary);
}

.alert-item.unread {
  background: rgba(59, 130, 246, 0.05);
}

.alert-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.alert-icon.info { background: rgba(59, 130, 246, 0.15); }
.alert-icon.warning { background: rgba(245, 158, 11, 0.15); }
.alert-icon.critical { background: rgba(239, 68, 68, 0.15); }

.alert-content {
  flex: 1;
  min-width: 0;
}

.alert-message {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

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

.alert-dismiss {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.alert-item:hover .alert-dismiss {
  opacity: 1;
}

.alerts-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

/* ===============================
   CUSTOM DASHBOARD WIDGETS
   =============================== */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.5rem;
}

.dashboard-widget {
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.dashboard-widget.dragging {
  opacity: 0.8;
  box-shadow: var(--shadow-lg);
  transform: scale(1.02);
}

.dashboard-widget.drag-over {
  border: 2px dashed var(--primary);
}

.dashboard-widget[data-width="quarter"] { grid-column: span 3; }
.dashboard-widget[data-width="third"] { grid-column: span 4; }
.dashboard-widget[data-width="half"] { grid-column: span 6; }
.dashboard-widget[data-width="two-thirds"] { grid-column: span 8; }
.dashboard-widget[data-width="full"] { grid-column: span 12; }

@media (max-width: 1024px) {
  .dashboard-widget[data-width="quarter"],
  .dashboard-widget[data-width="third"] { grid-column: span 6; }
  .dashboard-widget[data-width="half"],
  .dashboard-widget[data-width="two-thirds"],
  .dashboard-widget[data-width="full"] { grid-column: span 12; }
}

@media (max-width: 640px) {
  .dashboard-widgets {
    grid-template-columns: 1fr;
  }
  .dashboard-widget[data-width] {
    grid-column: span 1;
  }
}

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

.widget-header h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.widget-actions {
  display: flex;
  gap: 0.25rem;
}

.widget-action-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 4px;
  transition: background 0.2s;
}

.widget-action-btn:hover {
  background: var(--bg-secondary);
}

.widget-content {
  padding: 1.25rem;
}

.widget-placeholder {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* Widget customize panel */
.widgets-customize-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-primary);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.widgets-customize-panel.active {
  right: 0;
}

.customize-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 10;
}

.customize-widgets-list {
  padding: 1rem;
}

.customize-widget-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.customize-widget-item .widget-icon {
  font-size: 1.5rem;
}

.customize-widget-item .widget-info {
  flex: 1;
}

.customize-widget-item .widget-name {
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.customize-widget-item .widget-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===============================
   VOICE INPUT
   =============================== */
.voice-input-btn {
  background: var(--bg-secondary);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.voice-input-btn:hover {
  background: var(--primary);
  color: white;
}

.voice-input-btn.recording {
  background: var(--danger);
  color: white;
  animation: pulse-recording 1s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
}

@keyframes pulse-recording {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.voice-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary);
  border-radius: var(--radius-2xl);
  padding: 2rem;
  width: 320px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  z-index: 1002;
  animation: modalSlideIn 0.25s ease;
}

.voice-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1001;
}

.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 60px;
  margin: 1.5rem 0;
}

.voice-wave-bar {
  width: 4px;
  height: 20px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  animation: voice-wave 0.8s ease-in-out infinite;
}

.voice-wave-bar:nth-child(1) { animation-delay: 0s; }
.voice-wave-bar:nth-child(2) { animation-delay: 0.1s; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.2s; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.3s; }
.voice-wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes voice-wave {
  0%, 100% { height: 20px; }
  50% { height: 50px; }
}

.voice-transcript {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  min-height: 3rem;
}

.voice-parsed {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 1rem;
  margin-top: 1rem;
  text-align: left;
}

.voice-parsed-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.voice-parsed-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.voice-parsed-value {
  font-weight: 600;
}

/* ===============================
   COMPARISON REPORTS
   =============================== */
.comparison-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.comparison-period {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
}

.comparison-period-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.comparison-period-title {
  font-weight: 600;
  color: var(--text-primary);
}

.comparison-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.comparison-vs-circle {
  width: 48px;
  height: 48px;
  background: var(--primary-gradient);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: var(--shadow-colored);
}

.comparison-metric {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

.comparison-metric:last-child {
  border-bottom: none;
}

.comparison-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
}

.comparison-change.positive {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.comparison-change.negative {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* ===============================
   CASH FLOW FORECAST
   =============================== */
.forecast-container {
  padding: 1.5rem;
}

.forecast-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.forecast-summary-item {
  text-align: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.forecast-summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.forecast-summary-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
}

.forecast-months {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.forecast-month {
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  border-left: 3px solid var(--primary);
  transition: all var(--transition-base);
}

.forecast-month:hover {
  transform: translateX(4px);
}

.forecast-month-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.forecast-month-name {
  font-weight: 600;
  font-size: 1rem;
}

.forecast-month-balance {
  font-weight: 700;
  font-size: 1.1rem;
}

.forecast-month-balance.positive { color: var(--success); }
.forecast-month-balance.negative { color: var(--danger); }

.forecast-month-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  font-size: 0.85rem;
}

.forecast-detail {
  text-align: center;
  padding: 0.5rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
}

.forecast-detail-value {
  font-weight: 600;
}

.forecast-detail-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.forecast-chart {
  height: 200px;
  margin-top: 1.5rem;
}

/* ===============================
   ACTIVITY LOG
   =============================== */
.activity-log {
  max-height: 500px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.activity-item:hover {
  padding-left: 0.5rem;
}

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

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.activity-icon.login { background: rgba(16, 185, 129, 0.15); }
.activity-icon.transaction { background: rgba(99, 102, 241, 0.15); }
.activity-icon.settings { background: rgba(245, 158, 11, 0.15); }
.activity-icon.security { background: rgba(239, 68, 68, 0.15); }

.activity-content {
  flex: 1;
}

.activity-action {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.activity-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===============================
   FAB BUTTON MODERN STYLE
   =============================== */
.fab-container {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0));
  right: 20px;
  z-index: 900;
}

.fab-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: white;
  border: none;
  box-shadow: var(--shadow-colored);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all var(--transition-base);
}

.fab-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg), var(--shadow-colored);
}

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

.fab-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-base);
}

.fab-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  background: var(--bg-primary);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.fab-menu-item:hover {
  background: var(--bg-secondary);
  transform: translateX(-4px);
}

.fab-menu-item .icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.fab-menu-item.expense .icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.fab-menu-item.income .icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.fab-menu-item.transfer .icon {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

/* Mobile responsive for new features */
@media (max-width: 768px) {
  .comparison-container {
    grid-template-columns: 1fr;
  }
  
  .comparison-vs {
    flex-direction: row;
    padding: 0.5rem 0;
  }
  
  .alerts-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    max-height: 70vh;
  }
  
  .heatmap-cell {
    width: 10px;
    height: 10px;
  }
  
  .widgets-customize-panel {
    width: 100vw;
    right: -100vw;
  }

  .fab-container {
    bottom: calc(16px + env(safe-area-inset-bottom, 0));
    right: 16px;
  }

  .fab-btn {
    width: 52px;
    height: 52px;
  }
}

/* ===============================
   UTILITY CLASSES
   =============================== */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

.bg-success-soft { background: rgba(16, 185, 129, 0.1); }
.bg-danger-soft { background: rgba(239, 68, 68, 0.1); }
.bg-warning-soft { background: rgba(245, 158, 11, 0.1); }
.bg-primary-soft { background: rgba(99, 102, 241, 0.1); }

.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.rounded-full { border-radius: var(--radius-full); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-xs); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Smooth scroll for the whole page */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection colors */
::selection {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===============================
   GLOBAL SEARCH
   =============================== */
.global-search-wrapper {
  position: relative;
}

.global-search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  padding: 10vh 1rem;
}

.global-search-modal.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.global-search-container {
  width: 100%;
  max-width: 600px;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: searchSlideIn 0.2s ease-out;
}

@keyframes searchSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.global-search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  gap: 0.75rem;
}

.global-search-input-wrapper .search-icon {
  font-size: 1.25rem;
  opacity: 0.6;
}

.global-search-input-wrapper input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  outline: none;
  color: var(--text-primary);
}

.global-search-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.global-search-input-wrapper kbd {
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.global-search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.search-hint, .search-no-results {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.search-section {
  padding: 0.5rem 0;
}

.search-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  margin: 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result-item:hover {
  background: var(--bg-secondary);
}

.search-result-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

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

.search-result-title {
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-title mark {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  padding: 0.1em 0.2em;
  border-radius: 2px;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.search-result-amount {
  font-weight: 600;
  flex-shrink: 0;
}

.search-result-amount.income {
  color: var(--success);
}

.search-result-amount.expense {
  color: var(--danger);
}

/* ===============================
   ACCESSIBILITY
   =============================== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 1rem;
  background: var(--primary);
  color: white;
  z-index: 10000;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  top: 0;
}

/* Focus visible styles */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #000;
    --border-light: #333;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
}