* {
  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;
}

header {
  background: #2563eb;
  color: white;
  padding: 16px 20px;
  text-align: center;
}

header h1 {
  font-size: 1.3rem;
  font-weight: 700;
}

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

/* サマリー */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.summary-card {
  background: white;
  border-radius: 8px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.summary-card.highlight {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.summary-label {
  display: block;
  font-size: 0.72rem;
  color: #666;
  margin-bottom: 6px;
}

.summary-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: #2563eb;
}

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

.form-section h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #2563eb;
}

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

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

.required {
  color: #dc2626;
}

.form-row input,
.form-row select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-row input:focus,
.form-row select:focus {
  border-color: #2563eb;
}

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

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #2563eb;
  color: white;
  flex: 1;
}

.btn-secondary {
  background: #e5e7eb;
  color: #333;
}

/* フィルター */
.filter-section {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

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

/* 商談カード */
.deal-card {
  background: white;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-left: 4px solid #ccc;
}

.deal-card.stage-リード { border-left-color: #60a5fa; }
.deal-card.stage-提案  { border-left-color: #f59e0b; }
.deal-card.stage-交渉  { border-left-color: #f97316; }
.deal-card.stage-受注  { border-left-color: #22c55e; }
.deal-card.stage-失注  { border-left-color: #9ca3af; opacity: 0.7; }

.deal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.deal-client {
  font-size: 1rem;
  font-weight: 600;
  color: #111;
}

.deal-actions {
  display: flex;
  gap: 6px;
}

.btn-edit,
.btn-delete {
  padding: 4px 10px;
  border: none;
  border-radius: 4px;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
}

.btn-edit {
  background: #dbeafe;
  color: #1d4ed8;
}

.btn-delete {
  background: #fee2e2;
  color: #b91c1c;
}

.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.stage-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge-リード { background: #dbeafe; color: #1d4ed8; }
.badge-提案   { background: #fef3c7; color: #b45309; }
.badge-交渉   { background: #ffedd5; color: #c2410c; }
.badge-受注   { background: #dcfce7; color: #15803d; }
.badge-失注   { background: #f3f4f6; color: #6b7280; }

.deal-amount {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2563eb;
}

.deal-next {
  font-size: 0.85rem;
  color: #555;
}

.deal-date {
  font-size: 0.8rem;
  color: #888;
  margin-top: 2px;
}

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

@media (max-width: 480px) {
  .summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .summary-value {
    font-size: 1rem;
  }
  .summary-label {
    font-size: 0.65rem;
  }
}
