* {
  box-sizing: border-box;
}

:root {
  --bg: #eef1f8;
  --panel-bg: #ffffff;
  --item-bg: #f6f7fb;
  --item-border: #e3e6f0;
  --accent: #4f5ee0;
  --accent-dark: #3d4bc9;
  --accent-soft: #eef0fd;
  --text-main: #232538;
  --text-sub: #6b6f85;
  --text-faint: #a2a6b8;
  --danger: #e0435a;
  --danger-soft: #fdeaed;
  --success: #2fab6e;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(35, 37, 56, 0.06);
  --shadow-hover: 0 4px 16px rgba(35, 37, 56, 0.1);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

header {
  margin-bottom: 24px;
}

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

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--panel-bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.stat-icon {
  font-size: 26px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 50%;
  flex-shrink: 0;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.stat-label {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.panel {
  background: var(--panel-bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.latest-reflection {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
}

.latest-reflection h2 {
  color: #fff;
  opacity: 0.9;
}

.latest-reflection .reflection-week {
  color: #fff;
  opacity: 0.85;
  font-size: 13px;
}

.latest-reflection .reflection-comment {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  margin: 6px 0;
}

.latest-reflection .meta {
  color: rgba(255, 255, 255, 0.75);
}

.latest-reflection .empty {
  color: rgba(255, 255, 255, 0.85);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid .panel {
  margin-bottom: 0;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text-main);
}

.week-label {
  margin: -6px 0 12px;
  font-size: 13px;
  color: var(--text-sub);
}

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

.form input,
.form textarea {
  padding: 10px 12px;
  border: 1px solid var(--item-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  background: var(--item-bg);
  color: var(--text-main);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.form button {
  align-self: flex-start;
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.form button:hover {
  background: var(--accent-dark);
}

.form button:active {
  transform: scale(0.98);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}

.list-item {
  background: var(--item-bg);
  border: 1px solid var(--item-border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.list-item:hover {
  background: #fff;
  box-shadow: var(--shadow);
}

.note-item .note-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-main);
}

.note-item .note-body {
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 6px;
  line-height: 1.5;
}

.meta {
  font-size: 12px;
  color: var(--text-faint);
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left-color: var(--success);
}

.task-item.completed {
  border-left-color: var(--text-faint);
  opacity: 0.75;
}

.task-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.task-item .task-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-main);
}

.task-item.completed .task-text > div:first-child {
  text-decoration: line-through;
  color: var(--text-faint);
}

.task-item button {
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.task-item button:hover {
  background: #f9d2d8;
}

.reflection-item {
  border-left-color: var(--accent);
}

.reflection-item .reflection-week {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 4px;
}

.reflection-item .reflection-comment {
  font-size: 14px;
  color: var(--text-main);
  white-space: pre-wrap;
  line-height: 1.5;
  margin-bottom: 6px;
}

.empty {
  color: var(--text-faint);
  font-size: 14px;
  padding: 10px 0;
}

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