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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}

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

h1 {
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: #2c3e50;
  padding: 12px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

h2 {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 12px;
  color: #2c3e50;
}

h3 {
  font-size: 0.9rem;
  font-weight: bold;
  margin: 12px 0 8px;
  color: #555;
}

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

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

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

.required {
  color: #e74c3c;
}

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

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  background: #fff;
}

.btn-primary {
  display: inline-block;
  width: 100%;
  padding: 12px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: #95a5a6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

/* 集計カード */
.summary-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.card {
  background: #f0f8ff;
  border-radius: 8px;
  padding: 14px;
  text-align: center;
  border: 1px solid #d0e8ff;
}

.card-label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 6px;
}

.card-value {
  font-size: 1.6rem;
  font-weight: bold;
  color: #2980b9;
}

.card-value .unit {
  font-size: 1rem;
}

/* 理由別集計 */
.reason-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reason-badge {
  background: #ecf0f1;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.85rem;
  color: #555;
}

.reason-badge span {
  font-weight: bold;
  color: #e74c3c;
  margin-left: 4px;
}

/* 一覧 */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.filter-group select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fafafa;
}

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

.return-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.return-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px;
  background: #fafafa;
}

.return-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.return-product {
  font-weight: bold;
  font-size: 0.95rem;
  flex: 1;
  margin-right: 8px;
}

.return-date {
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
}

.return-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.tag {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 12px;
  background: #ecf0f1;
  color: #555;
}

.tag.status-受付中 { background: #fff3cd; color: #856404; }
.tag.status-返金済 { background: #d4edda; color: #155724; }
.tag.status-交換済 { background: #cce5ff; color: #004085; }
.tag.status-対応不可 { background: #f8d7da; color: #721c24; }

.return-refund {
  font-size: 0.9rem;
  color: #e74c3c;
  font-weight: bold;
}

.return-note {
  font-size: 0.82rem;
  color: #777;
  margin-top: 4px;
}

.return-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-edit {
  padding: 5px 12px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

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

.btn-delete {
  padding: 5px 12px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

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

/* モーダル */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-content h2 {
  margin-bottom: 16px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-buttons .btn-primary {
  flex: 1;
}

@media (max-width: 400px) {
  .summary-cards {
    grid-template-columns: 1fr;
  }

  .card-value {
    font-size: 1.3rem;
  }
}
