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

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

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

h1 {
  font-size: 1.5rem;
  color: #2e7d32;
  margin-bottom: 16px;
  text-align: center;
}

h2 {
  font-size: 1rem;
  color: #388e3c;
  margin-bottom: 12px;
}

h3 {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 10px;
}

/* カード */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

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

.form-row {
  display: flex;
  gap: 12px;
}

label {
  display: block;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 4px;
}

input[type="text"],
input[type="number"],
input[type="date"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #f9fff9;
  outline: none;
  transition: border 0.2s;
}

input:focus {
  border-color: #4caf50;
}

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

.btn:hover { opacity: 0.85; }

.btn-primary {
  background: #4caf50;
  color: #fff;
  width: 100%;
  margin-top: 4px;
  font-size: 1rem;
  padding: 12px;
}

.btn-water {
  background: #29b6f6;
  color: #fff;
  flex: 1;
}

.btn-fertilizer {
  background: #8d6e63;
  color: #fff;
  flex: 1;
}

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

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

/* フィルター */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid #a5d6a7;
  border-radius: 20px;
  background: #fff;
  color: #388e3c;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
  background: #4caf50;
  color: #fff;
  border-color: #4caf50;
}

/* 植物カード */
.plant-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: box-shadow 0.2s;
  border-left: 4px solid #4caf50;
}

.plant-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.plant-card.urgent {
  border-left-color: #f44336;
}

.plant-card.soon {
  border-left-color: #ff9800;
}

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

.plant-name {
  font-size: 1.05rem;
  font-weight: bold;
  color: #2e7d32;
}

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

.status-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.badge-ok { background: #e8f5e9; color: #388e3c; }
.badge-soon { background: #fff3e0; color: #e65100; }
.badge-urgent { background: #ffebee; color: #c62828; }

.plant-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.detail-item {
  font-size: 0.82rem;
  color: #555;
}

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

.detail-value {
  font-weight: 500;
}

.detail-next {
  font-size: 0.8rem;
  margin-top: 2px;
}

.next-ok { color: #388e3c; }
.next-soon { color: #e65100; }
.next-urgent { color: #c62828; font-weight: bold; }

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

/* モーダル */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  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: 16px;
  padding: 20px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: #2e7d32;
  margin-bottom: 14px;
}

.modal-btns {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 14px 0;
}

.modal-action-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.modal-action-btns .btn {
  flex: 1;
  min-width: 80px;
}

/* レスポンシブ */
@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .plant-details {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 1.3rem; }
}
