* {
  box-sizing: border-box;
}

:root {
  --bg: #eef1f6;
  --panel: #ffffff;
  --border: #e3e7ee;
  --text: #1f2430;
  --text-muted: #6b7280;
  --text-faint: #9aa1ac;
  --accent: #4361ee;
  --accent-dark: #3249c7;
  --accent-soft: #eef1ff;
  --danger: #e5484d;
  --danger-soft: #fdecec;
  --success: #2ba86a;
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.06);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.06), 0 8px 20px rgba(16, 24, 40, 0.08);
}

body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 40px 24px;
  line-height: 1.5;
}

.container {
  max-width: 980px;
  margin: 0 auto;
}

.app-header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

.dashboard {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

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

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

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

.stat-card.accent .stat-icon {
  background: #e5f7ec;
}

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

.stat-card.accent .stat-value {
  color: var(--success);
}

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

.reflection-highlight {
  background: linear-gradient(135deg, var(--accent) 0%, #6c7ef2 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.reflection-highlight-label {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 6px;
}

.reflection-highlight-week {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.reflection-highlight-comment {
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.95;
  white-space: pre-wrap;
}

.columns {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.column {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.reflection-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: -4px;
}

#reflection-week {
  align-self: flex-start;
}

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

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

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

#task-title {
  height: 149px;
}

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

input[type="text"],
textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fbfcfe;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12);
  background: #fff;
}

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

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

button:active {
  transform: translateY(1px);
}

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

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

.list::-webkit-scrollbar-thumb {
  background: #d7dce3;
  border-radius: 8px;
}

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

.list-item:hover {
  background: #f1f4fa;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}

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

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

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

.note-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.note-edit-form .task-actions {
  margin-top: 0;
}

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

.task-checkbox {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.task-title {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.5;
}

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

.task-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.icon-btn {
  align-self: auto;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.icon-btn.delete {
  color: var(--danger);
  border-color: #f3c6c6;
}

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

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

@media (max-width: 700px) {
  body {
    padding: 24px 16px;
  }

  .dashboard {
    flex-direction: column;
  }
}
