/* メインカラー。--main を変えれば全体の色味が変わる */
:root {
  --main: #FAC7C1;        /* メインカラー（ヘッダー・ボタンなどの背景） */
  --main-soft: #FDEDEB;   /* 一覧の背景などに使う薄い色 */
  --main-mid: #F0A79D;    /* 枠線・アクセント線 */
  --main-strong: #A63C30; /* 白地に置く文字・数字（読みやすさ確保のため濃いめ） */
  --on-main: #5C2A24;     /* メインカラーの上に乗せる文字 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #f4f6fa;
  color: #22262e;
  line-height: 1.6;
}

.site-header {
  background: linear-gradient(135deg, var(--main), #FBD9D5);
  color: var(--on-main);
  padding: 28px 20px;
  text-align: center;
}
.site-header h1 { margin: 0; font-size: 1.7rem; }
.site-header .sub { margin: 4px 0 0; opacity: .85; font-size: .9rem; }

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

.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

/* ダッシュボード */
.dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.stat { text-align: center; }
.stat-label { font-size: .85rem; color: #6b7280; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--main-strong); }
.stat.accent .stat-value { color: #e8590c; }
.stat.done .stat-value { color: #2b8a3e; }

/* ダッシュボードの最新の振り返り */
.latest-review {
  margin-bottom: 24px;
  border-left: 4px solid #7048e8;
}
.latest-review h2 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.week-label {
  font-size: .82rem;
  font-weight: 600;
  color: #7048e8;
  background: #f3efff;
  border-radius: 999px;
  padding: 2px 10px;
}

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

/* 週次の振り返り */
.review-section { margin-top: 20px; }
.review-section .item { border-left-color: #7048e8; }
.field-label { font-size: .82rem; color: #6b7280; }
.form input[type="week"] { max-width: 220px; }
.hint { font-size: .78rem; color: #868e96; margin: 0; }

h2 { font-size: 1.05rem; margin: 0 0 12px; }
.list-title { margin-top: 24px; border-top: 1px solid #eceef3; padding-top: 16px; }
.count {
  display: inline-block;
  background: var(--main-soft);
  color: var(--main-strong);
  border-radius: 999px;
  padding: 0 9px;
  font-size: .8rem;
  margin-left: 4px;
}

/* フォーム */
.form { display: flex; flex-direction: column; gap: 8px; }
.form input, .form textarea {
  border: 1px solid #d7dbe4;
  border-radius: 8px;
  padding: 10px;
  font-size: .95rem;
  font-family: inherit;
  width: 100%;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--main); border-color: var(--main-mid); }
.form textarea { resize: vertical; }
.form button {
  background: var(--main);
  color: var(--on-main);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
.form button:hover { background: var(--main-mid); }

/* 一覧 */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item {
  border: 1px solid #F3D9D5;
  border-left: 4px solid var(--main-mid);
  border-radius: 8px;
  padding: 12px;
  background: var(--main-soft);
  transition: background .15s, box-shadow .15s;
}
.item:hover { background: #FBE2DE; box-shadow: 0 2px 6px rgba(166, 60, 48, .12); }
.item.done {
  border-color: #dfe3e8;
  border-left-color: #adb5bd;
  background: #eceef2;
}
.item.done:hover { background: #e5e8ed; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.item-head { display: flex; align-items: center; gap: 8px; }
.item-title { font-weight: 600; flex: 1; word-break: break-word; }
.item.done .item-title { text-decoration: line-through; color: #868e96; }
/* 本文は白地にして読みやすくする */
.item-body {
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: 8px;
  padding: 8px 10px;
  background: #fff;
  border-radius: 6px;
  font-size: .92rem;
}
.item-meta { font-size: .78rem; color: #6b7280; margin-top: 8px; }

.badge {
  font-size: .72rem;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.badge.open { background: #fff0e6; color: #e8590c; }
.badge.done { background: #e6f4ea; color: #2b8a3e; }
.badge.current { background: #f3efff; color: #7048e8; }

.btn-sm {
  border: 1px solid #d7dbe4;
  background: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn-sm:hover { background: #f1f3f7; }
.btn-sm.danger { color: #c92a2a; border-color: #f2c2c2; }

.empty { color: #98a1ae; font-size: .9rem; padding: 12px 0; }

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

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