:root {
  /* Color Palette */
  --primary: #1e3a8a; /* Navy Blue */
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --secondary: #10b981; /* Green */
  --accent: #f59e0b; /* Amber */
  --danger: #ef4444;
  --text-dark: #111827;
  --text-medium: #4b5563;
  --text-light: #9ca3af;
  --bg-body: #f3f4f6;
  --bg-card: #ffffff;
  --border: #e5e7eb;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Layout */
  --max-width: 480px; /* Mobile app simulation width constraint for desktop view */
  --header-height: 60px;
  --nav-height: 70px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center; /* Center the mobile view on desktop */
}

/* Mobile App Container Simulation */
.app-container {
  width: 100%;
  max-width: var(--max-width);
  background-color: var(--bg-body);
  min-height: 100vh;
  position: relative;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  padding-bottom: var(--nav-height); /* Space for bottom nav */
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  color: var(--text-dark);
}

h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
p { margin: 0; line-height: 1.5; color: var(--text-medium); }

.text-2xl { font-size: 32px; }
.text-xl { font-size: 24px; }
.text-lg { font-size: 18px; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--secondary); }
.text-danger { color: var(--danger); }
.text-accent { color: var(--accent); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

/* Layout Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.p-md { padding: var(--space-md); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.mt-sm { margin-top: var(--space-sm); }
.mb-sm { margin-bottom: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }

/* Components */

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
}

.card-clickable {
  cursor: pointer;
  transition: transform 0.1s;
}

.card-clickable:active {
  transform: scale(0.98);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(30, 58, 138, 0.4);
}

.btn-primary:hover {
  background: #152d70;
}

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

.btn-success {
  background: var(--secondary);
  color: white;
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-dark);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  background: var(--bg-card);
}

.form-input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

/* Header */
.header {
  height: var(--header-height);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  justify-content: space-between;
}

.header-title {
  font-size: 18px;
  font-weight: 600;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: var(--max-width);
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 20;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  text-decoration: none;
  font-size: 10px;
  gap: 4px;
  width: 25%;
  height: 100%;
}

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

.nav-icon {
  width: 24px;
  height: 24px;
  background-color: #ddd; /* Placeholder for icon */
  border-radius: 4px;
}

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

/* Badges */
.badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--secondary); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--accent); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.badge-neutral { background: #e5e7eb; color: var(--text-medium); }

/* Search & Filter */
.search-bar {
  position: relative;
  margin-bottom: var(--space-md);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: #ccc;
  border-radius: 50%;
}

.search-input {
  padding-left: 40px;
}

.filter-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: var(--space-md);
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  white-space: nowrap;
  color: var(--text-medium);
  cursor: pointer;
}

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

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 20px;
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
  border-left: 2px solid var(--border);
  padding-left: 20px;
}
.timeline-item:last-child {
  border-left: none;
}
.timeline-dot {
  position: absolute;
  left: -9px;
  top: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
}

/* Placeholder Icons */
.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

/* Utility for specific page elements */
.login-header {
  padding: 60px 20px 40px;
  text-align: center;
}
.logo-placeholder {
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: 20px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 32px;
}

.money-display {
  font-family: 'Roboto', monospace;
  font-weight: 700;
}
