:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #1f2733;
  --ink-soft: #6b7686;
  --ink-faint: #9aa4b2;
  --line: #eceff4;
  --brand: #4f46e5;
  --brand-soft: #eef0fe;
  --memo: #f5b301;
  --memo-bg: #fffdf3;
  --task: #2f9df4;
  --task-bg: #f2f9ff;
  --danger: #ef4444;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ヘッダー（マスコット画像を背景に敷く） */
header {
  position: relative;
  background:
    linear-gradient(90deg, rgba(50, 42, 150, 0.72) 0%, rgba(60, 45, 160, 0.35) 45%, rgba(60, 45, 160, 0) 70%),
    url("mascot.svg") right center / cover no-repeat,
    linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  padding: 46px 24px;
  overflow: hidden;
}

header .header-inner {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
}

header h1,
header .subtitle {
  text-shadow: 0 1px 6px rgba(20, 16, 70, 0.55);
}

header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

header .subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

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

.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  font-size: 18px;
  opacity: 0.9;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 6px;
  color: var(--ink);
}

.stat-label {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--brand-soft), #fff);
  border-color: #dcdcfb;
}

.stat-card.highlight .stat-value {
  color: var(--brand);
}

/* 最新の振り返り（ダッシュボード直下） */
.latest-review {
  background: linear-gradient(135deg, #fff7ed, #fffdf7);
  border: 1px solid #fde3c4;
  border-left: 5px solid #fb923c;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.lr-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c2410c;
  margin-bottom: 6px;
}

.lr-week {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.lr-comment {
  font-size: 14px;
  color: #37414f;
  white-space: pre-wrap;
  word-break: break-word;
}

.lr-empty {
  font-size: 14px;
  color: var(--ink-soft);
}

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

.week-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

.week-picker input[type="date"] {
  padding: 10px 13px;
  border: 1px solid #dfe3ea;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fbfcfe;
  color: var(--ink);
  max-width: 220px;
}

.week-picker input[type="date"]:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.week-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.week-note span {
  font-weight: 700;
  color: var(--brand);
}

.week-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-faint);
}

#reviewList li {
  background: #fff7ed;
  border: 1px solid #fde3c4;
  border-left: 4px solid #fb923c;
}

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

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* 入力フォーム */
.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.form input,
.form textarea {
  padding: 11px 13px;
  border: 1px solid #dfe3ea;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fbfcfe;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.form input::placeholder,
.form textarea::placeholder {
  color: var(--ink-faint);
}

.form input:focus,
.form textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form button {
  padding: 11px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.form button:hover {
  background: #4338ca;
}

.form button:active {
  transform: translateY(1px);
}

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

.list li {
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.list li:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* メモ：左端に黄色のアクセントバー＋淡い背景 */
#memoList li {
  background: var(--memo-bg);
  border: 1px solid #f2e6bf;
  border-left: 4px solid var(--memo);
}

/* タスク：左端に青のアクセントバー＋淡い背景 */
#taskList li {
  background: var(--task-bg);
  border: 1px solid #d4e9fb;
  border-left: 4px solid var(--task);
}

/* 「まだありません」表示 */
.list li.empty {
  background: transparent;
  border: 1px dashed #dbe0e8;
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
  padding: 20px 12px;
}

.list li.empty:hover {
  transform: none;
  box-shadow: none;
}

.memo-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.memo-content {
  font-size: 14px;
  color: #37414f;
  white-space: pre-wrap;
  word-break: break-word;
}

.meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-faint);
}

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

.task-item input[type="checkbox"] {
  margin-top: 2px;
  width: 19px;
  height: 19px;
  accent-color: var(--task);
  cursor: pointer;
  flex-shrink: 0;
}

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

.task-title {
  font-size: 14.5px;
  font-weight: 600;
  word-break: break-word;
}

.task-title.done {
  text-decoration: line-through;
  color: var(--ink-faint);
  font-weight: 500;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.badge.open {
  background: #fef3c7;
  color: #92400e;
}

.badge.done {
  background: #d1fae5;
  color: #047857;
}

.del-btn {
  background: transparent;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 12.5px;
  padding: 2px 4px;
  border-radius: 6px;
  transition: color 0.12s ease, background 0.12s ease;
}

.del-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}
