:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #222;
  --muted: #777;
  --border: #e2e4e8;
  --primary: #3b6fd8;
  --primary-dark: #2c58b3;
  --danger: #d9534f;
  --done: #2e9d5b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
header h1 { margin: 0; font-size: 1.3rem; }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
}
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat.accent .stat-value { color: var(--primary); }
.stat.latest-review { grid-column: 1 / -1; }
.latest-review-comment { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.latest-review-comment.empty-text { color: var(--muted); font-size: 0.9rem; }

.review-panel { margin-top: 20px; }
.review-week-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-week-row label { font-size: 0.9rem; }
.review-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-week-label { font-weight: 600; }
.review-comment { white-space: pre-wrap; margin: 4px 0; word-break: break-word; }

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
}
.panel h2 { font-size: 1.05rem; margin: 8px 0 10px; }
.panel h2:not(:first-child) { margin-top: 24px; }

form { display: flex; flex-direction: column; gap: 8px; }
.inline-form { flex-direction: row; }
.inline-form input { flex: 1; }

input, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

button {
  font: inherit;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
}
button:hover { background: var(--primary-dark); }
button.small { padding: 4px 10px; font-size: 0.85rem; }
button.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
button.ghost:hover { background: #eef3fd; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.danger:hover { background: #fdeeee; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.empty { color: var(--muted); font-size: 0.9rem; border: none !important; padding: 4px 0 !important; }

.memo-title { font-weight: 600; }
.memo-body { white-space: pre-wrap; margin: 4px 0; word-break: break-word; }
.meta { color: var(--muted); font-size: 0.8rem; }
.memo-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.memo-edit .task-actions { justify-content: flex-end; }

.task { display: flex; align-items: center; gap: 10px; }
.task-main { flex: 1; min-width: 0; }
.task-text { word-break: break-word; }
.task.done .task-text { text-decoration: line-through; color: var(--muted); }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 1px 8px;
  border-radius: 10px;
  margin-right: 6px;
  background: #fff3e0;
  color: #b26a00;
}
.task.done .badge { background: #e6f4ec; color: var(--done); }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; }
