* { box-sizing: border-box; }

:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-muted: #f4f6f9;
  --border: #e2e6ed;
  --text: #1f2430;
  --text-muted: #6b7280;
  --text-faint: #9aa2b1;
  --accent: #4361ee;
  --accent-dark: #2f4bd0;
  --accent-soft: #eaefff;
  --green: #1e8a4c;
  --green-soft: #e5f6ec;
  --red: #c0392b;
  --red-soft: #fdecea;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.06);
}

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

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

.page-header {
  margin-bottom: 28px;
}

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

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

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

.card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card-icon {
  font-size: 22px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--accent-soft);
}

.card-task .card-icon {
  background: #eefaf1;
}

.card-pending .card-icon {
  background: #fff4e5;
}

.card-reflection .card-icon {
  background: #f3e9ff;
}

.latest-reflection {
  margin-bottom: 28px;
  align-items: flex-start;
}

.reflection-latest-text {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reflection-latest-week {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.reflection-latest-comment {
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.card-body {
  min-width: 0;
}

.card-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
  white-space: nowrap;
}

.card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

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

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

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

.panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.panel-icon {
  font-size: 16px;
}

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

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

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

.form input::placeholder,
.form textarea::placeholder {
  color: var(--text-faint);
}

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

.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: 480px;
  overflow-y: auto;
}

.item {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 0.15s;
}

.item:hover {
  border-color: #c9d0dc;
}

.item-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-word;
}

.item-body {
  font-size: 13px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
  line-height: 1.5;
}

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

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-item.done {
  background: #eceef2;
}

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

.task-main {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
  margin-bottom: 4px;
}

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

.btn-small {
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
  white-space: nowrap;
}

.btn-small:hover {
  filter: brightness(0.95);
}

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

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

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

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

.list::-webkit-scrollbar-thumb {
  background: #d5dae2;
  border-radius: 4px;
}

.list::-webkit-scrollbar-track {
  background: transparent;
}
