:root {
  --accent: #4c6ef5;
  --accent-strong: #3b5bdb;
  --accent-soft: #eef2ff;
  --ink: #1f2733;
  --ink-soft: #5b6675;
  --ink-faint: #939cab;
  --line: #e7ebf2;
  --surface: #ffffff;
  --shadow-sm: 0 1px 2px rgba(20, 34, 66, 0.06);
  --shadow-md: 0 6px 20px rgba(20, 34, 66, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Sans", "Meiryo", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, #eaf0ff 0%, rgba(234, 240, 255, 0) 60%),
    linear-gradient(180deg, #f6f8fc 0%, #eef1f7 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 56px;
}

/* ヘッダー */
header {
  background: linear-gradient(120deg, #3b5bdb 0%, #5b74f0 60%, #7b8ff5 100%);
  color: #fff;
  padding: 26px 0;
  box-shadow: 0 8px 24px rgba(59, 91, 219, 0.25);
}

header .wrap {
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

header .subtitle {
  margin-left: auto;
  font-size: 13px;
  opacity: 0.85;
  font-weight: 500;
}

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

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

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #7b8ff5);
}

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

.stat-num {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* 最新の振り返り（ダッシュボード内ハイライト） */
.latest-review {
  margin: 0 0 28px;
  padding: 20px 22px;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(120deg, #5f3dc4 0%, #7048e8 55%, #845ef7 100%);
  box-shadow: 0 8px 24px rgba(95, 61, 196, 0.25);
}

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

.latest-review-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.latest-review-week {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.latest-review-body {
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  opacity: 0.97;
}

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

.review-form input[type="week"] {
  max-width: 220px;
}

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

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

.panel h2 {
  margin: 0 0 18px;
  font-size: 17px;
  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: 22px;
}

.form input,
.form textarea {
  padding: 11px 13px;
  border: 1px solid #d6dce6;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fbfcfe;
  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;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(76, 110, 245, 0.15);
}

/* ボタン */
button {
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(76, 110, 245, 0.25);
}

button:hover { background: var(--accent-strong); }
button:active { transform: translateY(1px); }

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

.item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.item:hover {
  transform: translateX(2px);
  box-shadow: var(--shadow-md);
  border-color: #d4dcec;
}

.item-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 5px;
  color: var(--ink);
}

.item-body {
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--ink-soft);
}

.item-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge.done { background: #e6f7ea; color: #2b8a3e; }
.badge.open { background: #fff4d6; color: #a67908; }

.task-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

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

.item-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}

.btn-toggle { background: #2f9e44; box-shadow: 0 2px 6px rgba(47, 158, 68, 0.25); }
.btn-toggle:hover { background: #268a3a; }
.btn-del {
  background: #fff;
  color: #e03131;
  border: 1px solid #f1c9c9;
  box-shadow: none;
}
.btn-del:hover { background: #fdecec; }

.empty {
  color: var(--ink-faint);
  font-size: 14px;
  text-align: center;
  padding: 24px 0;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
}

/* レスポンシブ */
@media (max-width: 720px) {
  .dashboard { grid-template-columns: 1fr; }
  .columns { grid-template-columns: 1fr; }
  header .subtitle { display: none; }
}
