/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: #f0f6fc;
  color: #1a2b3c;
  padding-bottom: 80px; /* untuk nav mobile */
}
#app { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  background: #1A3B5C;
  color: white;
  padding: 16px 20px;
  border-radius: 0 0 20px 20px;
  margin: -16px -16px 20px -16px;
}
header .logo { font-weight: 700; font-size: 1.4rem; }
header .user { font-size: 0.9rem; opacity: 0.8; }

/* Page */
.page { display: none; }
.page.active { display: block; }

/* Card */
.balance-card, .income-expense, .coming-up, .toolbar, #transactionList, #chatMessages, #planList {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(26, 59, 92, 0.08);
}

.balance-card .balance { font-size: 1.8rem; font-weight: 700; color: #1A3B5C; }
.balance-card .today { font-size: 0.95rem; color: #5a7b9c; }
.income-expense { display: flex; gap: 20px; flex-wrap: wrap; }
.income-expense div { flex:1; }
.income-expense span { font-weight: 600; }

/* Chart */
.chart-container { background: white; border-radius: 16px; padding: 12px; margin: 16px 0; }

/* Buttons */
.btn-primary {
  background: #2E6B9E;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}
.btn-primary:hover { background: #1A4A6E; }
.btn-secondary {
  background: #e6f0fa;
  color: #1A3B5C;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
}

/* Navigation */
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  padding: 8px 0;
  z-index: 100;
}
nav ul {
  display: flex;
  justify-content: space-around;
  list-style: none;
  max-width: 600px;
  margin: 0 auto;
}
nav ul li {
  text-align: center;
  padding: 6px 12px;
  border-radius: 30px;
  cursor: pointer;
  color: #8899aa;
  transition: 0.2s;
}
nav ul li.active {
  background: #e6f0fa;
  color: #1A3B5C;
  font-weight: 600;
}
nav ul li i { display: block; font-size: 1.3rem; }
nav ul li span { font-size: 0.7rem; display: block; }

/* Chat */
#chatMessages {
  height: 300px;
  overflow-y: auto;
  background: #f8fafc;
  padding: 12px;
  border-radius: 16px;
}
.chat-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.chat-input input { flex:1; padding: 12px; border: 1px solid #b3d4f0; border-radius: 30px; }
.chat-input button {
  background: #2E6B9E;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.2rem;
  cursor: pointer;
}
.quick-actions { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.quick-actions button {
  background: #e6f0fa;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,0.3);
  justify-content: center;
  align-items: center;
  z-index: 200;
}
.modal-content {
  background: white;
  padding: 30px;
  border-radius: 24px;
  max-width: 500px;
  width: 90%;
  position: relative;
}
.close { position: absolute; right: 20px; top: 10px; font-size: 1.8rem; cursor: pointer; }
.modal-content label { display: block; margin-top: 12px; font-weight: 500; }
.modal-content input, .modal-content select {
  width: 100%;
  padding: 10px;
  border: 1px solid #b3d4f0;
  border-radius: 8px;
  margin-top: 4px;
}

/* Responsive PC */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  nav { position: static; background: transparent; box-shadow: none; margin-top: 20px; }
  nav ul { max-width: 100%; justify-content: flex-start; gap: 10px; }
  nav ul li { display: flex; align-items: center; gap: 8px; padding: 10px 18px; }
  nav ul li i { display: inline; font-size: 1rem; }
  nav ul li span { display: inline; font-size: 0.9rem; }
  .page { display: block !important; } /* all visible, tapi kita toggle dengan JS untuk SPA */
  #page-dashboard, #page-detail, #page-chat, #page-plans, #page-settings { display: none; }
  #page-dashboard.active, #page-detail.active, #page-chat.active, #page-plans.active, #page-settings.active { display: block; }
  #app { padding: 0 30px; }
}

/* Misc */
#transactionList .transaction-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #eef3f8;
}
#transactionList .transaction-item .info { flex:1; }
#transactionList .transaction-item .amount { font-weight: 600; }
.amount.negative { color: #d32f2f; }
.amount.positive { color: #2e7d32; }