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

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

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

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
}

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

section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* 残高入力 */
.balance-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.balance-input-row input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
}

.balance-input-row input:focus {
  border-color: #3498db;
}

.yen-label {
  font-size: 1rem;
  color: #666;
  white-space: nowrap;
}

/* サマリー */
.summary-section {
  background: #f0f4ff;
  border: 2px solid #d0daff;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #dde5ff;
}

.summary-row:last-of-type {
  border-bottom: none;
  margin-bottom: 12px;
}

.summary-label {
  font-size: 0.9rem;
  color: #555;
}

.summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c3e50;
}

.status-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #ddd;
  color: #666;
  margin-top: 4px;
}

.status-badge.ok {
  background: #d4f5e2;
  color: #1a7f4b;
}

.status-badge.ng {
  background: #fde0dc;
  color: #c0392b;
}

/* フォーム */
.form-row {
  margin-bottom: 10px;
}

.form-row input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-row input[type="text"]:focus {
  border-color: #3498db;
}

.two-col {
  display: flex;
  gap: 12px;
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 0.8rem;
  color: #777;
}

.input-group {
  position: relative;
}

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

.input-group input:focus {
  border-color: #3498db;
}

.unit-label {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 0.85rem;
  color: #999;
}

.btn-add {
  width: 100%;
  padding: 12px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.btn-add:hover {
  background: #2980b9;
}

/* 一覧 */
.list-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-count {
  font-size: 0.8rem;
  font-weight: 400;
  color: #999;
}

.item-list {
  list-style: none;
}

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

.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}

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

.item-info {
  flex: 1;
}

.item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
}

.item-day {
  font-size: 0.8rem;
  color: #999;
  margin-top: 2px;
}

.item-amount {
  font-size: 1rem;
  font-weight: 700;
  color: #2c3e50;
  white-space: nowrap;
}

.btn-delete {
  background: none;
  border: none;
  color: #e74c3c;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
  line-height: 1;
}

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

@media (max-width: 400px) {
  .two-col {
    flex-direction: column;
  }
}
