* { box-sizing: border-box; }

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --ink: #1e2432;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f8;
  --surface: #ffffff;
  --row: #f8f9fc;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.08);
}

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

/* ---------- header ---------- */

header {
  background: linear-gradient(135deg, #4f46e5, #6366f1 55%, #7c7ff2);
  color: #fff;
  padding: 28px 24px;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.header-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.82);
}

/* ---------- layout ---------- */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

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

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

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

/* ---------- cards ---------- */

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

.panel h2:first-of-type { margin-top: 0; }

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 20px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.stat-icon { font-size: 1.3rem; margin-bottom: 2px; }
.stat-label { font-size: 0.85rem; color: var(--muted); }
.stat-value { font-size: 2.25rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }

.stat-accent { background: var(--primary-light); border-color: #e0e4fb; }
.stat-accent .stat-value { color: var(--primary-dark); }

h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--ink);
}
.h2-icon { font-size: 1rem; }

.list-heading {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

/* ---------- 最新の振り返り（ダッシュボード） ---------- */

.highlight {
  background: linear-gradient(135deg, var(--primary-light), #fff 70%);
  border-color: #dfe3fb;
  margin-bottom: 20px;
}
.highlight h2 { margin-top: 0; }

.review-week-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: #fff;
  border: 1px solid #dfe3fb;
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 8px;
}

.review-comment {
  font-size: 1rem;
  white-space: pre-wrap;
  color: var(--ink);
}

.empty-inline {
  color: var(--muted);
  font-size: 0.92rem;
}

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

/* ---------- forms ---------- */

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

input, textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 100%;
  background: var(--row);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea { resize: vertical; }

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s ease, transform 0.1s ease;
}
button:hover { background: var(--primary-dark); }
button:active { transform: scale(0.98); }

/* ---------- lists ---------- */

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

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

.list li:hover {
  background: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.list li.empty {
  background: transparent;
  border: 1px dashed #cbd5e1;
  border-left: 1px dashed #cbd5e1;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 18px 14px;
}
.list li.empty:hover { background: transparent; box-shadow: none; }

.memo-title { font-weight: 700; }
.memo-title.done { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.memo-body { white-space: pre-wrap; color: #374151; margin-top: 2px; }
.meta { font-size: 0.78rem; color: #9aa2b1; margin-top: 6px; }

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task-title.done { text-decoration: line-through; color: var(--muted); font-weight: 500; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 6px;
}
.badge.open { background: #fef3c7; color: #92400e; }
.badge.done { background: #dcfce7; color: #166534; }

.task-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.task-actions button { padding: 5px 10px; font-size: 0.78rem; white-space: nowrap; }
.btn-delete { background: #ef4444; }
.btn-delete:hover { background: #dc2626; }
.btn-toggle { background: #10b981; }
.btn-toggle:hover { background: #059669; }
.btn-edit { background: #64748b; }
.btn-edit:hover { background: #475569; }

/* ---------- scrollbar ---------- */

.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-track { background: transparent; }
.list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 999px; }
