:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --primary: #4f6df5;
  --primary-dark: #3b57d6;
  --text: #22262e;
  --muted: #8a929e;
  --border: #e4e8ef;
  --danger: #e5484d;
  --done: #12a150;
  --shadow: 0 2px 8px rgba(30, 40, 70, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.app-header {
  background: linear-gradient(135deg, #4f6df5, #6b8bff);
  color: #fff;
  padding: 24px 20px;
  text-align: center;
}

.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.subtitle {
  margin: 4px 0 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ダッシュボード */
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-card.highlight {
  background: linear-gradient(135deg, #fff4e5, #ffe9cc);
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-card.highlight .stat-value {
  color: #d9730d;
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 2px;
}

/* 2カラム */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 720px) {
  .dashboard {
    grid-template-columns: repeat(3, 1fr);
  }
  .columns {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

/* 入力欄 */
.input-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.input-block input,
.input-block textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e4e8ef;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
}

.input-block input:focus,
.input-block textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.input-block button {
  align-self: flex-start;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.input-block button:hover {
  background: var(--primary-dark);
}

/* 一覧 */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  border: 1px solid #eef1f6;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafbfd;
}

.note-title {
  font-weight: 600;
  margin: 0 0 4px;
}

.note-content {
  margin: 0 0 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 16px 0;
}

/* タスク行 */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-item input[type="checkbox"] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-title {
  word-break: break-word;
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}

.badge.open {
  background: #fff0e5;
  color: #d9730d;
}

.badge.done {
  background: #e6f7ee;
  color: var(--done);
}

/* 削除ボタン */
.del-btn {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.del-btn:hover {
  background: #fdeaea;
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

/* 最新の振り返り（ダッシュボード下） */
.latest-review {
  background: linear-gradient(135deg, #eef2ff, #f6f0ff);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.latest-review h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

.latest-review .review-week {
  font-weight: 700;
  color: var(--primary-dark);
}

.latest-review .review-comment {
  margin: 6px 0 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 振り返りパネル */
.review-panel {
  margin-top: 20px;
}

.field-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 2px 0 0;
}

.review-week {
  font-weight: 700;
}
