:root {
  --navy: #0b1f4d;
  --blue-900: #1e3a8a;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --sky-500: #0ea5e9;
  --sky-100: #e0f2fe;
  --blue-50: #eff6ff;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5fb;
  --danger: #e11d48;
  --success: #0d9488;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(30, 58, 138, .08);
}

* { box-sizing: border-box; }

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

/* ヘッダー */
header {
  background: linear-gradient(120deg, var(--navy) 0%, var(--blue-900) 45%, var(--blue-600) 100%);
  color: #fff;
  padding: 28px 16px 84px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 18px;
}
.today { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .78); }

main {
  max-width: 1200px;
  margin: -56px auto 0;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ダッシュボード */
.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--accent);
}
.stat.notstarted { --accent: var(--slate-400); }
.stat.doing { --accent: var(--sky-500); }
.stat.undone { --accent: var(--blue-600); }
.stat .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 34px; font-weight: 700; color: var(--blue-900); line-height: 1.2; }
.stat.notstarted .value { color: var(--danger); }

/* レイアウト */
.columns {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 1.8fr;
  gap: 20px;
  align-items: start;
}
.columns > .panel:first-child { position: sticky; top: 16px; }

.panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-900);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel h2::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sky-500), var(--blue-600));
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-head h2 { margin: 0; }

/* フォーム */
form { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; }
.row input { flex: 1; min-width: 0; }
input, textarea {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 100%;
  background: #f8fafc;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}
textarea { resize: vertical; }

button {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  transition: transform .1s, box-shadow .15s, background .15s, opacity .15s;
}
button:active { transform: translateY(1px); }
.btn-primary {
  font-size: 14px;
  padding: 11px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-600), var(--blue-900));
  box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}
.btn-primary:hover { box-shadow: 0 6px 18px rgba(37, 99, 235, .38); }

/* 絞り込み */
.filters {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--blue-50);
  border-radius: 10px;
}
.filter { background: transparent; color: var(--slate-500); padding: 6px 12px; }
.filter:hover { color: var(--blue-700); }
.filter.active { background: #fff; color: var(--blue-700); box-shadow: 0 1px 4px rgba(30, 58, 138, .15); }

/* 一覧 */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.list li {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.list li:hover { border-color: #bfdbfe; box-shadow: 0 4px 14px rgba(30, 58, 138, .07); }
.list li.empty {
  border: 1px dashed var(--line);
  color: var(--slate-400);
  font-size: 14px;
  text-align: center;
  box-shadow: none;
}

.memo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.memo-grid li { border-top: 3px solid var(--blue-500); }
.memo-grid li.empty { grid-column: 1 / -1; border-top: 1px dashed var(--line); }

.memo-text, .task-memo { white-space: pre-wrap; word-break: break-word; }
.memo-text { font-size: 14px; }
.meta { font-size: 12px; color: var(--slate-400); margin-top: 8px; }

/* タスク */
.list li.doing { border-left: 4px solid var(--sky-500); }
.list li.todo { border-left: 4px solid var(--slate-400); }
.list li.done { border-left: 4px solid var(--success); background: #fafcff; }

.task-head { display: flex; align-items: flex-start; gap: 10px; }
.task-title { font-weight: 700; font-size: 15px; flex: 1; word-break: break-word; }
li.done .task-title { text-decoration: line-through; color: var(--slate-400); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-700);
}
.chip small { color: var(--slate-500); margin-right: 4px; }

.task-memo {
  font-size: 13px;
  color: #334155;
  background: #f8fafc;
  border-left: 3px solid #bfdbfe;
  padding: 8px 10px;
  border-radius: 6px;
  margin-top: 10px;
}

.badge {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.todo { background: #f1f5f9; color: var(--slate-500); }
.badge.doing { background: var(--sky-100); color: #0369a1; }
.badge.done { background: #ccfbf1; color: #0f766e; }

.actions { display: flex; gap: 6px; margin-top: 12px; justify-content: flex-end; flex-wrap: wrap; }
.btn-doing { background: var(--sky-100); color: #0369a1; }
.btn-doing:hover { background: #bae6fd; }
.btn-done { background: var(--blue-600); color: #fff; }
.btn-done:hover { background: var(--blue-700); }
.btn-todo { background: #f1f5f9; color: var(--slate-500); }
.btn-todo:hover { background: #e2e8f0; }
.btn-delete { background: transparent; color: var(--slate-400); }
.btn-delete:hover { background: #fff1f2; color: var(--danger); }

@media (max-width: 860px) {
  .columns { grid-template-columns: 1fr; }
  .columns > .panel:first-child { position: static; }
}
@media (max-width: 520px) {
  .dashboard { gap: 10px; }
  .stat { padding: 14px 14px 14px 18px; }
  .stat .value { font-size: 26px; }
  .row { flex-direction: column; }
}
