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

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

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

header {
  background: #c0392b;
  color: #fff;
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
}

header h1 {
  font-size: 1.4rem;
}

/* フィルター */
.filter-bar {
  background: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.filter-bar label {
  font-size: 0.9rem;
  color: #555;
  white-space: nowrap;
}

.filter-bar select {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
}

/* 統計 */
.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  flex: 1;
  min-width: 80px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.stat-card .stat-num {
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: #888;
}

.stat-card.unhandled .stat-num { color: #e74c3c; }
.stat-card.inprogress .stat-num { color: #e67e22; }
.stat-card.done .stat-num { color: #27ae60; }

/* フォーム */
.form-section {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-section h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: #c0392b;
  border-left: 4px solid #c0392b;
  padding-left: 10px;
}

.form-row {
  margin-bottom: 14px;
}

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

.form-row input[type="text"],
.form-row input[type="date"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fafafa;
  transition: border-color 0.2s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: #c0392b;
  background: #fff;
}

.required {
  color: #e74c3c;
}

.btn-primary {
  background: #c0392b;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #a93226;
}

.btn-secondary {
  background: #aaa;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #888;
}

/* 一覧 */
.list-section {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.list-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.list-header h2 {
  font-size: 1.1rem;
  color: #c0392b;
  border-left: 4px solid #c0392b;
  padding-left: 10px;
}

.count {
  font-size: 0.85rem;
  color: #888;
}

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

/* クレームカード */
.claim-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
  transition: box-shadow 0.2s;
}

.claim-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.claim-card.status-未対応 {
  border-left: 4px solid #e74c3c;
}

.claim-card.status-対応中 {
  border-left: 4px solid #e67e22;
}

.claim-card.status-完了 {
  border-left: 4px solid #27ae60;
  opacity: 0.75;
}

.claim-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.claim-date {
  font-size: 0.8rem;
  color: #888;
}

.claim-customer {
  font-weight: 600;
  font-size: 1rem;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-未対応 {
  background: #fde8e8;
  color: #c0392b;
}

.badge-対応中 {
  background: #fef3e2;
  color: #d35400;
}

.badge-完了 {
  background: #e8f8ee;
  color: #1e8449;
}

.claim-content {
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.claim-meta {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: #666;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.claim-memo {
  font-size: 0.82rem;
  color: #777;
  background: #f9f9f9;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.claim-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-status {
  font-size: 0.8rem;
  padding: 5px 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  cursor: pointer;
  background: #f5f5f5;
  transition: background 0.15s;
}

.btn-status:hover {
  background: #eee;
}

.btn-edit {
  font-size: 0.8rem;
  padding: 5px 12px;
  border: 1px solid #aaa;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  color: #555;
}

.btn-edit:hover {
  background: #f0f0f0;
}

.btn-delete {
  font-size: 0.8rem;
  padding: 5px 12px;
  border: 1px solid #e74c3c;
  border-radius: 5px;
  cursor: pointer;
  background: #fff;
  color: #e74c3c;
  margin-left: auto;
}

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

/* モーダル */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  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: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: #c0392b;
  border-left: 4px solid #c0392b;
  padding-left: 10px;
}

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

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

@media (max-width: 480px) {
  .stats {
    gap: 8px;
  }

  .stat-card {
    padding: 8px 10px;
  }

  .claim-top {
    flex-direction: column;
    gap: 4px;
  }
}
