* {
  box-sizing: border-box;
}

:root {
  --color-bg: #eef1f6;
  --color-surface: #ffffff;
  --color-border: #e5e8ef;
  --color-text: #1a1d29;
  --color-text-muted: #6b7280;
  --color-text-faint: #9ca3af;
  --color-primary: #4f46e5;
  --color-primary-dark: #4338ca;
  --color-primary-soft: #eef0fe;
  --color-danger: #dc2626;
  --color-danger-soft: #fef2f2;
  --color-success: #16a34a;
  --color-success-soft: #f0fdf4;
  --color-warning: #b45309;
  --color-warning-soft: #fffbeb;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.07);
  --radius-lg: 16px;
  --radius-md: 10px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  background:
    radial-gradient(1200px 500px at 15% -10%, #eef0ff 0%, rgba(238, 240, 255, 0) 60%),
    radial-gradient(900px 400px at 100% 0%, #eefcf6 0%, rgba(238, 252, 246, 0) 55%),
    var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}

h1 {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.subtitle {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 32px;
}

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

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

.dashboard-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.dashboard-value {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-primary);
  line-height: 1.1;
}

.dashboard-value.completed {
  color: var(--color-success);
}

.dashboard-value.pending {
  color: var(--color-danger);
}

.dashboard-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.latest-reflection {
  background: linear-gradient(135deg, var(--color-primary) 0%, #7c3aed 100%);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  color: #fff;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
}

.latest-reflection-label {
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0.85;
  margin-bottom: 8px;
}

.latest-reflection-body {
  font-size: 0.95rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.latest-reflection-week {
  font-weight: 700;
  font-size: 0.85rem;
  opacity: 0.9;
}

.latest-reflection-comment {
  white-space: pre-wrap;
  word-break: break-word;
}

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

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

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

.panel h2 {
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--color-border);
}

.field-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: -2px;
}

.reflection-panel {
  margin-top: 22px;
}

.form input,
.form textarea {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fafbfc;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--color-text);
  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(--color-text-faint);
}

.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.form button {
  align-self: flex-start;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.1s ease;
}

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

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

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.list::-webkit-scrollbar {
  width: 6px;
}

.list::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: #fdfdfe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.item:hover {
  border-color: #d7dae3;
  box-shadow: var(--shadow-sm);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.item-title {
  font-weight: 700;
  font-size: 0.95rem;
  word-break: break-word;
}

.item-body {
  margin-top: 6px;
  white-space: pre-wrap;
  color: var(--color-text-muted);
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.item-meta {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--color-text-faint);
}

.item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.item-actions button {
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.item-actions button:hover {
  filter: brightness(0.96);
}

.item-actions button:active {
  transform: scale(0.96);
}

.btn-done {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.btn-undo {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.btn-delete {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

.task-title {
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

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

.empty {
  color: var(--color-text-faint);
  font-size: 0.88rem;
  text-align: center;
  padding: 28px 0;
}
