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

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

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

h1 {
  text-align: center;
  font-size: 1.4rem;
  color: #1565c0;
  margin-bottom: 16px;
}

h2 {
  font-size: 1rem;
  color: #1565c0;
  margin-bottom: 10px;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.input-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.input-row input[type="text"],
.input-row input[type="number"] {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

.btn-primary {
  background: #1976d2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}
.btn-primary:hover { background: #1565c0; }

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

.tag-list li button {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.tag-list li button:hover { color: #c62828; }

/* テーブル */
.table-wrapper {
  overflow-x: auto;
}

.collection-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.collection-table th,
.collection-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

.collection-table thead th {
  background: #1976d2;
  color: #fff;
  font-weight: 600;
}

.collection-table thead th:first-child {
  background: #1565c0;
  text-align: left;
}

.collection-table tbody tr:nth-child(even) { background: #f5f9ff; }
.collection-table tbody td:first-child { text-align: left; font-weight: 500; }

.check-cell {
  cursor: pointer;
  font-size: 1.2rem;
  user-select: none;
}
.check-cell.paid { color: #388e3c; }
.check-cell.unpaid { color: #bbb; }

/* 回収率 */
.rate-cell { font-size: 0.8rem; color: #555; }

/* 未払い */
.unpaid-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.unpaid-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #fff3f3;
  border-left: 4px solid #e53935;
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
}

.unpaid-item .amount { color: #c62828; font-weight: 600; }

.total-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 1rem;
}

.total-amount {
  color: #c62828;
  font-size: 1.2rem;
}

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