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

:root {
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --primary: #4f6ef7;
  --primary-dark: #3a55d0;
  --text: #222;
  --muted: #8a90a2;
  --border: #e3e7f0;
  --danger: #e5484d;
  --done: #9aa0ad;
  --item-bg: #f7f9fc;
  --item-border: #d5dbe8;
}

body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 40px;
}

.app-header {
  background: var(--primary);
  color: #fff;
  padding: 18px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.app-header h1 {
  font-size: 1.5rem;
}

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

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

.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.stat {
  padding: 20px;
  text-align: center;
}

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

.stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

/* 最新の振り返り（ダッシュボード） */
.latest-reflection {
  padding: 16px 20px;
  margin-bottom: 28px;
  border-left: 5px solid #f0a500;
}

.latest-reflection-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.latest-reflection-icon {
  font-size: 1.1rem;
}

.latest-reflection-title {
  font-weight: 700;
}

.latest-reflection-week {
  color: var(--muted);
  font-size: 0.85rem;
}

.latest-reflection-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.latest-reflection.empty .latest-reflection-body {
  color: var(--muted);
}

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

.reflection-panel .list li {
  border-left-color: #f0a500;
}

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

.input-area input[type="date"] {
  width: auto;
}

.week-preview {
  font-size: 0.85rem;
  font-weight: 600;
  color: #c67a00;
}

.hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.reflection-week-label {
  font-weight: 600;
  margin-bottom: 4px;
}

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

.panel {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.panel h2 {
  font-size: 1.2rem;
  margin-bottom: 14px;
}

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

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

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

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

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

/* リスト */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list li {
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.15s, transform 0.15s;
}

.list li:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* 完了済みタスクは色を落ち着かせる */
.list li.task-item.done {
  background: #eef0f4;
  border-left-color: var(--done);
}

/* 空メッセージには枠線やアクセントを付けない */
.list li.empty {
  background: transparent;
  border: 1px dashed var(--item-border);
  border-left: 1px dashed var(--item-border);
  box-shadow: none;
}

.memo-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.memo-content {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}

.meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 6px;
}

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

/* タスク行 */
.list li.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left-color: #1f9d55;
}

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

.task-body {
  flex: 1;
}

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

.task-title {
  font-size: 0.95rem;
  word-break: break-word;
}

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

.badge.pending {
  background: #fff2e0;
  color: #c67a00;
}

.badge.complete {
  background: #e3f7e8;
  color: #1f9d55;
}

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

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

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

/* レスポンシブ */
@media (max-width: 720px) {
  .dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat {
    padding: 14px 8px;
  }
  .stat-value {
    font-size: 1.6rem;
  }
  .columns {
    grid-template-columns: 1fr;
  }
}
