* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: #f4f5f7;
  color: #222;
}

header {
  background: #2f3a56;
  color: #fff;
  padding: 16px 24px;
}
header h1 { margin: 0; font-size: 1.4rem; }

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

/* ダッシュボード */
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.stat-label { font-size: 0.85rem; color: #666; }
.stat-value { font-size: 2rem; font-weight: bold; margin-top: 4px; }

/* 項目ごとの色分け（メモ=青、タスク=緑、完了タスク件数=赤） */
.stat-memo { border-left: 6px solid #3b6fd8; background: #eef3fd; }
.stat-memo .stat-value { color: #3b6fd8; }
.stat-task { border-left: 6px solid #2e9e5b; background: #ecf8f1; }
.stat-task .stat-value { color: #2e9e5b; }
.stat-done { border-left: 6px solid #d9534f; background: #fdeeee; }
.stat-done .stat-value { color: #d9534f; }
.stat-review { grid-column: 1 / -1; border-left: 6px solid #7a4fc4; background: #f4effc; }
.stat-review .stat-label span { color: #7a4fc4; font-weight: bold; margin-left: 6px; }
.latest-review {
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  /* 長い場合は3行で省略 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.latest-review.empty { color: #999; }

/* 振り返り */
.review-area { margin-top: 24px; align-items: start; }
.field-label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: #555; }
.review-week { font-weight: bold; color: #7a4fc4; }
.review-comment { margin: 6px 0; white-space: pre-wrap; word-break: break-word; }

/* レイアウト */
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.column { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }

/* フォーム */
form { display: flex; flex-direction: column; gap: 8px; }
.inline-form { flex-direction: row; }
.inline-form input { flex: 1; }

input, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  width: 100%;
}
textarea { resize: vertical; }

button {
  font: inherit;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #3b6fd8;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}
button:hover { background: #2e5bb8; }
button.danger { background: #fff; color: #d9534f; border: 1px solid #d9534f; padding: 4px 10px; }
button.danger:hover { background: #fdecea; }
button.secondary { background: #fff; color: #7a4fc4; border: 1px solid #7a4fc4; padding: 4px 10px; margin-top: 6px; }
button.secondary:hover { background: #f4effc; }

/* 一覧 */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid #eee; padding: 12px 0; }
.list li:first-child { border-top: none; }
.empty { color: #999; font-size: 0.9rem; }

.memo-title { font-weight: bold; }
.memo-body { margin: 6px 0; white-space: pre-wrap; }
.meta { font-size: 0.8rem; color: #888; }

.task { display: flex; align-items: center; gap: 10px; }
.task input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
.task-main { flex: 1; min-width: 0; }
.task-text { word-break: break-word; }
.task.done .task-text { text-decoration: line-through; color: #999; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 1px 8px;
  border-radius: 10px;
  margin-right: 6px;
  background: #fff3cd;
  color: #8a6d00;
}
.badge.done { background: #dff0d8; color: #3c763d; }

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.5rem; }
}
