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

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

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

h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 20px;
  color: #1a202c;
}

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

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

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

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

input[type="text"],
input[type="number"],
input[type="datetime-local"],
select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  color: #333;
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: #3182ce;
}

/* 基準値設定行 */
.form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-row input {
  flex: 1;
  min-width: 120px;
}

/* ボタン */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: #3182ce;
  color: #fff;
  width: 100%;
  margin-top: 4px;
}

.btn-secondary {
  background: #718096;
  color: #fff;
  white-space: nowrap;
}

.btn-danger {
  background: #e53e3e;
  color: #fff;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.85rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: #a0aec0;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.2s;
}

.btn-icon:hover {
  color: #e53e3e;
}

/* 基準値リスト */
.threshold-list {
  list-style: none;
  margin-top: 10px;
}

.threshold-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: #edf2f7;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.threshold-item .loc-name {
  font-weight: 600;
  color: #2b6cb0;
}

.threshold-item .threshold-val {
  color: #4a5568;
}

/* フィルター行 */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.filter-row select {
  flex: 1;
  min-width: 120px;
}

/* 件数表示 */
.record-count {
  font-size: 0.85rem;
  color: #718096;
  margin-bottom: 8px;
}

.record-count .alert-count {
  color: #e53e3e;
  font-weight: 600;
}

/* 記録リスト */
.record-list {
  list-style: none;
}

.record-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 4px solid #48bb78;
  background: #f7fafc;
  transition: background 0.2s;
}

.record-item.alert {
  border-left-color: #e53e3e;
  background: #fff5f5;
}

.record-info {
  flex: 1;
}

.record-location {
  font-weight: 600;
  font-size: 0.95rem;
  color: #2d3748;
}

.record-temp {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2b6cb0;
  margin: 2px 0;
}

.record-item.alert .record-temp {
  color: #c53030;
}

.record-temp .alert-badge {
  font-size: 0.75rem;
  background: #e53e3e;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 600;
}

.record-datetime {
  font-size: 0.8rem;
  color: #718096;
  margin-top: 2px;
}

.record-memo {
  font-size: 0.82rem;
  color: #718096;
  margin-top: 3px;
  font-style: italic;
}

.record-actions {
  display: flex;
  align-items: center;
  margin-left: 8px;
}

/* 空メッセージ */
.empty-msg {
  text-align: center;
  color: #a0aec0;
  font-size: 0.9rem;
  padding: 24px 0;
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-row .btn {
    width: 100%;
  }
}
