* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  background: #f0f2f5;
  color: #2c3e50;
  line-height: 1.5;
  font-size: 13px;
}

.app-header {
  background: linear-gradient(135deg, #4b6cb7, #182848);
  color: #fff;
  padding: 12px;
  text-align: center;
}

.app-header h1 {
  font-size: 1.2rem;
  font-weight: 600;
}

.container {
  max-width: 900px;
  margin: 14px auto;
  padding: 0 14px;
}

/* ---- ダッシュボード ---- */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.dashboard > .stat-card,
.task-stats-group .stat-card {
  flex: 0 1 160px;
}

/* タスク件数・依頼中タスク・完了タスクを1つの枠にまとめる */
.task-stats-group {
  flex: 1 1 0%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: #fff1f0;
  border: 2px solid #e57373;
  border-radius: 12px;
  padding: 10px;
}

/* 画面が狭い場合は、メモ枠とグループを縦に並べ、グループ内の3枚は均等幅で横並びにする */
@media (max-width: 560px) {
  .dashboard {
    flex-direction: column;
  }

  .dashboard > .stat-card {
    flex: 1 1 auto;
  }

  .task-stats-group .stat-card {
    flex: 1 1 0;
  }
}

.stat-card {
  background: #fff;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-card.highlight-note {
  background: #fff9db;
  border-color: #f5d947;
}

.stat-card.highlight-done {
  background: #dde6f4;
  border-color: #2c4a7c;
}

.stat-card.highlight-task {
  background: #e8eefa;
  border-color: #4b6cb7;
}

.stat-card.highlight-requested {
  background: #f0f5fc;
  border-color: #7fa0d9;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* ---- 最新の振り返り（ダッシュボード下） ---- */
.latest-review {
  background: #fff;
  border-left: 4px solid #4b6cb7;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.latest-review-label {
  font-size: 0.75rem;
  color: #4b6cb7;
  font-weight: 600;
  margin-bottom: 3px;
}

.latest-review-week {
  display: inline-block;
  background: #eef2fb;
  color: #3a559c;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  margin-right: 8px;
}

.latest-review-text {
  font-size: 0.85rem;
  color: #495563;
}

.review-panel {
  margin-top: 14px;
}

/* ---- 今週完了 / 次週予定の要約 ---- */
.review-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

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

.summary-block {
  background: #f7f9fc;
  border-radius: 8px;
  padding: 10px;
}

.summary-block h3 {
  font-size: 0.82rem;
  margin-bottom: 8px;
  color: #4b6cb7;
}

.list-item.compact {
  padding: 6px 9px;
}

/* ---- レイアウト ---- */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.panel {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.panel h2 {
  font-size: 1rem;
  margin-bottom: 10px;
  border-bottom: 2px solid #eef0f4;
  padding-bottom: 6px;
}

/* ---- 入力欄 ---- */
.input-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.input-block input,
.input-block textarea {
  border: 1px solid #d4d9e0;
  border-radius: 6px;
  padding: 7px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
}

.input-block input:focus,
.input-block textarea:focus {
  outline: none;
  border-color: #4b6cb7;
}

.input-block button {
  background: #4b6cb7;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.input-block button:hover {
  background: #3a559c;
}

#note-form button {
  background: #f5d947;
  color: #4a3f00;
}

#note-form button:hover {
  background: #e0c62f;
}

#task-form button {
  background: #4b6cb7;
}

#task-form button:hover {
  background: #3a559c;
}

/* ---- 一覧 ---- */
.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.list-item {
  border: 1px solid #eef0f4;
  border-radius: 6px;
  padding: 9px;
  background: #fafbfc;
}

.note-title {
  font-weight: 600;
  margin-bottom: 3px;
}

.note-content {
  white-space: pre-wrap;
  font-size: 0.82rem;
  color: #495563;
}

.meta {
  font-size: 0.72rem;
  color: #8a94a3;
  margin-top: 4px;
}

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

.task-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.task-body {
  flex: 1;
}

.task-title-row {
  margin-bottom: 4px;
  cursor: pointer;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

/* 期限と依頼先は常にセットで表示し、離れて折り返されないようにする */
.due-assignee-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---- タスクの編集フォーム ---- */
.task-edit-item {
  background: #fffceb;
}

.task-edit-item .task-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-edit-item .edit-title,
.task-edit-item .edit-row input {
  border: 1px solid #d4d9e0;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
  font-family: inherit;
}

.edit-row {
  display: flex;
  gap: 6px;
}

.edit-row input {
  flex: 1;
  min-width: 0;
}

.edit-actions {
  display: flex;
  gap: 8px;
}

.edit-actions button {
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-save {
  background: #4b6cb7;
  color: #fff;
}

.btn-cancel {
  background: #e5e8ed;
  color: #495563;
}

.task-title.done {
  text-decoration: line-through;
  color: #a0a8b3;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
}

.badge.pending {
  background: #ffe6e2;
  color: #d9534f;
}

.badge.done {
  background: #e2f5e6;
  color: #3c9d5a;
}

.badge.due {
  background: #eef2fb;
  color: #3a559c;
}

.badge.overdue {
  background: #ffe6e2;
  color: #d9534f;
}

.badge.assignee {
  background: #eaf1fd;
  color: #2f5faa;
}

/* 期限入力（任意） */
.due-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #6b7482;
}

.due-field input {
  flex: 1;
}

.btn-delete {
  background: transparent;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px 6px;
  border-radius: 6px;
}

.btn-delete:hover {
  background: #fbe9e7;
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.empty {
  color: #a0a8b3;
  font-size: 0.9rem;
  text-align: center;
  padding: 12px;
}
