* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  background: #f4f6fa;
  color: #23272f;
}

.header {
  background: #2f6fed;
  color: #fff;
  padding: 18px 24px;
}

.header h1 {
  margin: 0;
  font-size: 20px;
}

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

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

.stat {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-label {
  display: block;
  font-size: 13px;
  color: #6b7280;
}

.stat-value {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  font-weight: 700;
}

.stat-alert .stat-value { color: #e5533d; }
.stat-done .stat-value { color: #24803c; }

/* ダッシュボード：最新の振り返り */
.latest-review {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 26px;
  border-left: 3px solid #8a5cf0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.latest-review-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.latest-review-head .stat-label { display: inline; }

.latest-review-week {
  font-size: 13px;
  font-weight: 600;
  color: #6d43d6;
}

.latest-review-body {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.6;
  color: #444b57;
}

.latest-review-body.is-empty { color: #9aa0ab; }

/* パネル */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; }
  /* カードが縦に4つ並ぶと間延びするので2列にする */
  .dashboard { grid-template-columns: repeat(2, 1fr); }
}

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

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

.panel-wide { margin-top: 20px; }

.sub-heading {
  margin: 20px 0 12px;
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}

/* 週の切り替え */
.week-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.week-nav button {
  padding: 7px 12px;
  background: #eef1f7;
  color: #444b57;
}

.week-nav button:hover { background: #dfe4ee; }

.week-label {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: center;
  font-weight: 600;
}

.week-key {
  font-size: 12px;
  font-weight: 400;
  color: #8a909c;
}

.btn-sub { font-size: 13px; }

.item-review { border-left-color: #8a5cf0; }

.review-week {
  font-size: 13px;
  font-weight: 700;
  color: #6d43d6;
}

/* フォーム */
.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.form-inline {
  flex-direction: row;
}

.form-inline input { flex: 1; }

input, textarea {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid #d7dbe3;
  border-radius: 6px;
  width: 100%;
  resize: vertical;
}

input:focus, textarea:focus {
  outline: none;
  border-color: #2f6fed;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  background: #2f6fed;
  color: #fff;
  white-space: nowrap;
}

button:hover { background: #2559c9; }

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

.item {
  border: 1px solid #e6e9ef;
  border-left: 3px solid #2f6fed;
  border-radius: 6px;
  padding: 10px 12px;
}

.item-title {
  font-weight: 600;
  word-break: break-word;
}

.item-body {
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  color: #444b57;
}

.item-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #8a909c;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #fde8e4;
  color: #c33d27;
}

.badge.done {
  background: #e2f4e6;
  color: #24803c;
}

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

.task input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: none;
  cursor: pointer;
}

.task-main { flex: 1; }

.item.is-done { border-left-color: #38a55a; }
.item.is-done .item-title {
  text-decoration: line-through;
  color: #9aa0ab;
}

.btn-delete {
  background: none;
  color: #9aa0ab;
  padding: 2px 6px;
  font-size: 13px;
}

.btn-delete:hover {
  background: #fdecea;
  color: #d13b28;
}

.empty {
  color: #9aa0ab;
  font-size: 14px;
  padding: 8px 0;
}
