* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  margin: 0;
  background: #eef1f6;
  color: #2c3e50;
  line-height: 1.5;
}

/* ヘッダー（グラデーション） */
.app-header {
  background: linear-gradient(120deg, #6a11cb 0%, #2575fc 100%);
  color: #fff;
  padding: 22px 28px;
  box-shadow: 0 2px 10px rgba(37, 117, 252, 0.25);
}

.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

/* ダッシュボード（色分けカード） */
.dashboard {
  display: flex;
  gap: 18px;
  padding: 24px 28px 8px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 150px;
  border-radius: 16px;
  padding: 22px 20px;
  text-align: center;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

/* 3枚それぞれ違う色 */
.dashboard .stat-card:nth-child(1) {
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.dashboard .stat-card:nth-child(2) {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}
.dashboard .stat-card:nth-child(3) {
  background: linear-gradient(135deg, #f7971e, #ffd200);
}
.dashboard .stat-card:nth-child(4) {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}

.stat-value {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  margin-top: 8px;
  font-size: 0.88rem;
  opacity: 0.95;
}

/* 最新の振り返り（ダッシュボード帯） */
.latest-reflection {
  margin: 8px 28px 0;
  padding: 18px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, #ee9ca7, #ffdde1);
  box-shadow: 0 6px 16px rgba(238, 156, 167, 0.3);
}

.latest-reflection-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #8e3b46;
  margin-bottom: 6px;
}

.latest-reflection-body {
  color: #5c2a31;
}

.latest-reflection-body .lr-week {
  display: inline-block;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.6);
  padding: 2px 10px;
  border-radius: 20px;
  margin-right: 10px;
  font-size: 0.85rem;
}

.latest-reflection-body .lr-comment {
  white-space: pre-wrap;
}

/* レイアウト */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 16px 28px 48px;
}

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

.column {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* パネル（カード） */
.panel {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel h2::before {
  content: "";
  width: 10px;
  height: 22px;
  border-radius: 4px;
  display: inline-block;
}

/* パネル見出しのアクセント色 */
.panel.memo-add h2::before,
.panel.memo-list h2::before {
  background: #764ba2;
}
.panel.task-add h2::before,
.panel.task-list h2::before {
  background: #11998e;
}
.panel.reflection-add h2::before,
.panel.reflection-list h2::before {
  background: #e8618c;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  color: #7a8699;
  margin-bottom: 4px;
}

input[type="week"] {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 12px;
  border: 1.5px solid #e1e6ef;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
}

input[type="week"]:focus {
  outline: none;
  border-color: #e8618c;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 12px;
  border: 1.5px solid #e1e6ef;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: #2575fc;
}

button {
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease;
}

button:hover {
  filter: brightness(1.08);
}

.panel.memo-add button {
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.panel.task-add button {
  background: linear-gradient(135deg, #11998e, #38ef7d);
}

/* リスト */
.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty {
  color: #a3adba;
  font-size: 0.9rem;
  padding: 10px 0;
  text-align: center;
}

/* メモカード（左ボーダーの色をローテーション） */
.memo-item {
  border-radius: 12px;
  padding: 14px 16px;
  background: #fbfbfe;
  border-left: 6px solid #764ba2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.memo-item:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.09);
}

.memo-list .memo-item:nth-child(5n + 1) {
  border-left-color: #764ba2;
  background: #f7f4fc;
}
.memo-list .memo-item:nth-child(5n + 2) {
  border-left-color: #2575fc;
  background: #f0f6ff;
}
.memo-list .memo-item:nth-child(5n + 3) {
  border-left-color: #11998e;
  background: #eefaf6;
}
.memo-list .memo-item:nth-child(5n + 4) {
  border-left-color: #f7971e;
  background: #fff8ec;
}
.memo-list .memo-item:nth-child(5n + 5) {
  border-left-color: #e74c3c;
  background: #fdf1f0;
}

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

.memo-item .memo-body {
  white-space: pre-wrap;
  font-size: 0.92rem;
  color: #4a5568;
}

.timestamp {
  margin-top: 8px;
  font-size: 0.75rem;
  color: #a3adba;
}

/* タスクカード */
.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1.5px solid #eef1f6;
  border-left: 6px solid #11998e;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.task-item:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.09);
}

.task-item.done {
  border-left-color: #b0bec5;
  background: #f6f8fa;
}

.task-item .task-main {
  flex: 1;
}

.task-item .task-text {
  font-size: 0.98rem;
  font-weight: 500;
}

.task-item.done .task-text {
  text-decoration: line-through;
  color: #95a5a6;
  font-weight: 400;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.badge.open {
  background: #fdecea;
  color: #c0392b;
}

.badge.done {
  background: #e8f6ef;
  color: #27ae60;
}

.task-item button {
  padding: 7px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-toggle {
  background: #27ae60;
}

.btn-delete {
  background: #e74c3c;
}

/* 週次の振り返りセクション */
.reflection-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 0 28px 48px;
  align-items: start;
}

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

.panel.reflection-add button {
  background: linear-gradient(135deg, #e8618c, #f7971e);
}

.reflection-item {
  border-radius: 12px;
  padding: 14px 16px;
  background: #fdf3f6;
  border-left: 6px solid #e8618c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.reflection-item:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.09);
}

.reflection-item .reflection-week {
  font-weight: 700;
  color: #c2416a;
  margin-bottom: 6px;
}

.reflection-item .reflection-comment {
  white-space: pre-wrap;
  font-size: 0.92rem;
  color: #4a5568;
}

.reflection-item .reflection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.reflection-item .reflection-footer .timestamp {
  margin-top: 0;
}

.reflection-item .btn-delete {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
}
