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

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

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #5b8dee;
}

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

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

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

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #dde1e7;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #333;
  background: #fafbfc;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #5b8dee;
  background: #fff;
}

.btn {
  display: inline-block;
  padding: 9px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:active {
  opacity: 0.75;
}

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

.btn-primary:hover {
  background: #4a7de0;
}

.btn-worn {
  background: #27ae60;
  color: #fff;
  font-size: 0.8rem;
  padding: 5px 12px;
}

.btn-delete {
  background: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  font-size: 0.8rem;
  padding: 5px 10px;
}

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

.filter-btn {
  padding: 6px 12px;
  border: 1px solid #dde1e7;
  border-radius: 20px;
  background: #fff;
  font-size: 0.8rem;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-btn.active {
  background: #5b8dee;
  border-color: #5b8dee;
  color: #fff;
}

.filter-btn:hover:not(.active) {
  border-color: #5b8dee;
  color: #5b8dee;
}

/* アイテムカード */
.item-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-info {
  flex: 1;
}

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

.item-meta {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 6px;
}

.item-days {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
}

.days-ok {
  background: #eafaf1;
  color: #27ae60;
}

.days-warn {
  background: #fef9e7;
  color: #e67e22;
}

.days-alert {
  background: #fdecea;
  color: #e74c3c;
}

.days-never {
  background: #f0f0f0;
  color: #888;
}

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  flex-shrink: 0;
}

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

/* レスポンシブ */
@media (max-width: 480px) {
  .item-card {
    flex-direction: column;
  }
  .item-actions {
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
  }
}
