:root {
  --navy: #002060;   /* メインカラー */
  --gold: #FFC000;   /* アクセントカラー */
  --blue: #0070C0;   /* サブカラー */
  --bg: #f4f6fa;
  --line: #d9dfea;
  --text: #1c2331;
  --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Meiryo, "メイリオ", "Hiragino Sans", sans-serif;
  line-height: 1.6;
}

.app-header {
  background: var(--navy);
  color: #fff;
  padding: 18px 24px;
  border-bottom: 4px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.app-header h1 { margin: 0; font-size: 20px; letter-spacing: .04em; }
.app-header .subtitle { margin: 2px 0 0; font-size: 13px; opacity: .8; }
.app-header .logout-btn { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; flex-shrink: 0; }
.app-header .logout-btn:hover { border-color: #fff; }

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

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--navy);
  border-left: 4px solid var(--blue);
  padding-left: 8px;
}
.count { font-size: 12px; color: var(--muted); font-weight: normal; margin-left: 6px; }

/* ダッシュボード */
.dashboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 8px; border-top: 4px solid var(--navy); }
.stat.accent { border-top-color: var(--gold); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.stat.accent .stat-value { color: #b37c00; }

/* 最新の振り返り（ダッシュボード直下のハイライトカード） */
.card.highlight { border-top: 4px solid var(--blue); }
.reflection-week { font-size: 12px; color: var(--blue); font-weight: 600; }
.reflection-comment { font-size: 14px; white-space: pre-wrap; word-break: break-word; margin-top: 4px; }
.reflection-empty { color: var(--muted); font-size: 13px; }

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

/* フォーム */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 12px; color: var(--muted); }
.form input[type="text"], .form input[type="week"], .form textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }

.btn { border: none; border-radius: 4px; cursor: pointer; font-size: 13px; padding: 8px 14px; font-family: inherit; }
.btn-primary { background: var(--navy); color: #fff; margin-top: 8px; align-self: flex-start; }
.btn-primary:hover { background: #00174a; }
.btn-mini { background: #fff; border: 1px solid var(--line); color: var(--muted); padding: 3px 8px; font-size: 12px; }
.btn-mini:hover { border-color: var(--blue); color: var(--blue); }
.btn-mini.danger:hover { border-color: #c62828; color: #c62828; }

/* 一覧 */
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  border-top: 1px solid var(--line);
  padding: 10px 2px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.list li:first-child { border-top: none; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; font-size: 14px; word-break: break-word; }
.item-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.item-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.badge { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; margin-right: 6px; }
.badge-open { background: #fff4d1; color: #8a6100; border: 1px solid var(--gold); }
.badge-done { background: #e8f1fb; color: var(--blue); border: 1px solid var(--blue); }
.done .item-title { text-decoration: line-through; color: var(--muted); }

.empty { color: var(--muted); font-size: 13px; padding: 8px 2px; }

.message {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 8px 16px; border-radius: 4px; font-size: 13px;
}
.message.error { background: #c62828; }

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; }
  .dashboard { grid-template-columns: 1fr; }
  .stat { flex-direction: row; justify-content: space-between; padding: 10px 14px; }
}
