:root {
  /* Colors - Dark Mode "Calming" Palette */
  --bg-body: #121214;
  --bg-surface: #1E1E22;
  --bg-surface-elevated: #27272C;
  
  --text-primary: #F2F2F5;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;

  /* Accents - Pastels optimized for dark mode */
  --color-expense: #F87171; /* Soft Red */
  --color-expense-bg: rgba(248, 113, 113, 0.15);
  
  --color-investment: #818CF8; /* Soft Indigo */
  --color-investment-bg: rgba(129, 140, 248, 0.15);
  
  --color-income: #34D399; /* Soft Emerald */
  --color-income-bg: rgba(52, 211, 153, 0.15);

  --primary-gradient: linear-gradient(135deg, #818CF8 0%, #C084FC 100%);
  
  /* Borders */
  --border-subtle: #3F3F46;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-body);
  color: var(--text-primary);
  /* Subtle gradient background */
  background-image: radial-gradient(circle at 0% 0%, rgba(129, 140, 248, 0.08) 0%, transparent 50%),
                    radial-gradient(circle at 100% 100%, rgba(52, 211, 153, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  justify-content: center; /* Center mobile view on desktop */
}

/* Mobile Container Wrapper */
.mobile-wrapper {
  width: 100%;
  max-width: 480px; /* Mobile width cap */
  min-height: 100vh;
  background: var(--bg-body);
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  padding-bottom: 80px; /* Space for nav */
}

/* Typography */
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
p { font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.small-text { font-size: 12px; color: var(--text-muted); }

/* Icons */
.icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-surface-elevated);
}

/* Layout Utilities */
.row { display: flex; align-items: center; gap: var(--spacing-md); }
.col { display: flex; flex-direction: column; gap: var(--spacing-sm); }
.space-between { justify-content: space-between; }
.align-center { align-items: center; }
.mt-2 { margin-top: var(--spacing-md); }
.mb-2 { margin-bottom: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.px-3 { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }

/* Components */

/* App Bar */
.app-bar {
  padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  background: rgba(18, 18, 20, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.app-bar-top {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Mascot Area */
.mascot-area {
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
  border: 1px solid rgba(255,255,255,0.05);
}
.mascot-avatar {
  width: 48px;
  height: 48px;
  background: #FDE047; /* Pikachu yellow placeholder */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(253, 224, 71, 0.3);
}

/* Forms */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  font-weight: 500;
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 16px;
  transition: all 0.2s;
  appearance: none;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: #818CF8;
  background: var(--bg-surface-elevated);
}

/* Date Picker Mock */
.date-picker-trigger {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
}

/* Chips/Pills for "Paid By" */
.chip-group {
  display: flex;
  gap: var(--spacing-md);
}

.chip-radio {
  display: none;
}

.chip-label {
  flex: 1;
  text-align: center;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.chip-radio:checked + .chip-label {
  background: var(--bg-surface-elevated);
  border-color: #818CF8;
  color: #818CF8;
  box-shadow: 0 0 15px rgba(129, 140, 248, 0.2);
}

/* Buttons */
.btn {
  padding: 14px 24px;
  border-radius: var(--radius-pill);
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(129, 140, 248, 0.4);
}

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

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
}

/* Cards */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.summary-card {
  padding: var(--spacing-md);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* Summary Card Variants */
.summary-card.expense.active {
  background: var(--bg-surface-elevated);
  border-color: var(--color-expense);
  box-shadow: 0 8px 24px -4px rgba(248, 113, 113, 0.3);
}
.summary-card.investment.active {
  background: var(--bg-surface-elevated);
  border-color: var(--color-investment);
  box-shadow: 0 8px 24px -4px rgba(129, 140, 248, 0.3);
}
.summary-card.income.active {
  background: var(--bg-surface-elevated);
  border-color: var(--color-income);
  box-shadow: 0 8px 24px -4px rgba(52, 211, 153, 0.3);
}

.summary-card .icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.sc-expense .icon-box { background: var(--color-expense-bg); color: var(--color-expense); }
.sc-invest .icon-box { background: var(--color-investment-bg); color: var(--color-investment); }
.sc-income .icon-box { background: var(--color-income-bg); color: var(--color-income); }

.amount-lg { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.amount-sm { font-size: 12px; color: var(--text-muted); }

/* Transaction List */
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding-bottom: var(--spacing-lg);
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tx-details { flex: 1; }
.tx-title { font-weight: 600; font-size: 15px; color: var(--text-primary); margin-bottom: 2px; }
.tx-sub { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.tx-amount { font-weight: 700; font-size: 15px; }

/* Colors for TX Types */
.type-expense .tx-icon { background: var(--color-expense-bg); color: var(--color-expense); }
.type-expense .tx-amount { color: var(--color-expense); }

.type-income .tx-icon { background: var(--color-income-bg); color: var(--color-income); }
.type-income .tx-amount { color: var(--color-income); }

.type-invest .tx-icon { background: var(--color-investment-bg); color: var(--color-investment); }
.type-invest .tx-amount { color: var(--color-investment); }

/* Tips Area */
.micro-tip {
  background: rgba(129, 140, 248, 0.1);
  border: 1px dashed rgba(129, 140, 248, 0.3);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  display: flex;
  gap: var(--spacing-sm);
  align-items: flex-start;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Calendar Mock */
.calendar-wrapper {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 8px;
}
.cal-day {
  font-size: 12px;
  color: var(--text-muted);
  padding-bottom: 8px;
}
.cal-date {
  font-size: 14px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
}
.cal-date.active {
  background: var(--bg-surface-elevated); /* Will be overridden by js/specific class */
  color: white;
  font-weight: 700;
}
.cal-date.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: white;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: rgba(18, 18, 20, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  padding: 12px 0 24px;
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
}

.nav-item.active {
  color: #818CF8;
}

.nav-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Badge */
.badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
}

/* Chart Placeholder */
.chart-placeholder {
  height: 200px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 20px;
  position: relative;
}
.bar {
  width: 8%;
  background: var(--bg-surface-elevated);
  border-radius: 4px 4px 0 0;
  transition: height 1s ease;
}

