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

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

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

h1 {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 20px;
  color: #2c7a2c;
}

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

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

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

input[type="text"],
input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus {
  border-color: #2c7a2c;
}

#addBtn {
  width: 100%;
  padding: 12px;
  background: #2c7a2c;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

#addBtn:hover {
  background: #235f23;
}

/* リスト */
.list-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: #666;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.expired { background: #e74c3c; }
.dot.soon    { background: #f39c12; }

ul {
  list-style: none;
}

li {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9f9f9;
  border-left: 4px solid #ccc;
}

li.expired {
  background: #fdecea;
  border-left-color: #e74c3c;
}

li.soon {
  background: #fff8e1;
  border-left-color: #f39c12;
}

li.ok {
  background: #f0fff0;
  border-left-color: #2c7a2c;
}

.item-info {
  flex: 1;
}

.item-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
}

.item-meta {
  font-size: 0.8rem;
  color: #666;
}

.item-meta .expiry-label {
  margin-left: 8px;
  font-weight: 600;
}

.expired .item-meta .expiry-label { color: #e74c3c; }
.soon .item-meta .expiry-label    { color: #e67e00; }
.ok .item-meta .expiry-label      { color: #2c7a2c; }

.delete-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  color: #888;
  margin-left: 10px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.delete-btn:hover {
  background: #e74c3c;
  color: #fff;
  border-color: #e74c3c;
}

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

@media (max-width: 375px) {
  h1 { font-size: 1.2rem; }
  li { flex-direction: column; align-items: flex-start; gap: 8px; }
  .delete-btn { margin-left: 0; }
}
