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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  text-align: center;
  font-size: 1.4rem;
  color: #2c5f9e;
  padding: 16px 0 8px;
  border-bottom: 2px solid #2c5f9e;
  margin-bottom: 20px;
}

h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 12px;
}

/* 入力セクション */
.input-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 4px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #2c5f9e;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #2c5f9e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1e4a7a;
}

/* 月ナビ・合計 */
.summary-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.btn-nav {
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  cursor: pointer;
  color: #2c5f9e;
  transition: background 0.2s;
}

.btn-nav:hover {
  background: #f0f4fa;
}

#current-month {
  font-size: 1.1rem;
  font-weight: bold;
  color: #333;
  min-width: 110px;
  text-align: center;
}

.total-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0f4fa;
  border-radius: 8px;
  padding: 12px 16px;
}

.total-label {
  font-size: 0.9rem;
  color: #666;
}

.total-amount {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c5f9e;
}

/* 記録一覧 */
.records-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.records-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  padding: 20px 0;
}

.record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
}

.record-info {
  flex: 1;
}

.record-date {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 2px;
}

.record-detail {
  font-size: 0.9rem;
  color: #555;
}

.record-pay {
  font-size: 1.1rem;
  font-weight: bold;
  color: #2c5f9e;
  margin: 0 12px;
  white-space: nowrap;
}

.btn-delete {
  background: none;
  border: 1px solid #ffb3b3;
  border-radius: 5px;
  color: #e55;
  font-size: 0.8rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-delete:hover {
  background: #fff0f0;
}

@media (max-width: 480px) {
  .record-item {
    flex-wrap: wrap;
    gap: 6px;
  }
  .record-pay {
    margin: 0;
  }
}
