/* ===== 業務フロー / タスク 共通スタイル ===== */

/* レベルバッジ */
.level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-left: 6px;
}
.level-auto       { background:#dcfce7; color:#166534; }
.level-semi_auto  { background:#fef9c3; color:#854d0e; }
.level-manual     { background:#e5e7eb; color:#374151; }
.level-approval   { background:#fee2e2; color:#991b1b; }

/* ステップカード */
.step-card {
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:14px 16px;
  margin-bottom:10px;
  position:relative;
}
.step-head {
  font-weight:600;
  color:#1e3a8a;
  margin-bottom:6px;
  display:flex; align-items:center; flex-wrap:wrap; gap:6px;
}
.step-meta {
  font-size:13px;
  color:#6b7280;
  margin-bottom:6px;
}
.step-desc { font-size:14px; }
.step-notes {
  margin-top:8px;
  padding:8px 10px;
  background:#fffbeb;
  border-left:3px solid #f59e0b;
  font-size:13px;
  border-radius:4px;
}

/* 編集モード時のステップ */
.step-card.editing {
  border-color:#3b82f6;
  background:#eff6ff;
}
.step-edit-grid {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:8px;
  margin-top:8px;
}
.step-edit-grid label {
  display:flex; flex-direction:column; font-size:12px; color:#6b7280;
}
.step-edit-grid input,
.step-edit-grid select,
.step-edit-grid textarea {
  width:100%; padding:6px 8px;
  border:1px solid #d1d5db; border-radius:4px; font-size:13px;
}
.step-edit-grid label.full { grid-column: 1 / -1; }

.step-controls {
  position:absolute; right:8px; top:8px;
  display:flex; gap:4px;
}
.step-controls button {
  padding:2px 8px; font-size:12px;
  border:1px solid #d1d5db; background:#f9fafb;
  border-radius:4px; cursor:pointer;
}
.step-controls button:hover { background:#e5e7eb; }
.step-controls .btn-del { color:#991b1b; }

/* 自動化率ボックス */
.rate-box {
  display:inline-block;
  padding:6px 14px;
  background:#eff6ff;
  color:#1e3a8a;
  border-radius:20px;
  font-weight:600;
}

/* Mermaid */
.mermaid-wrap {
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:16px;
  margin:12px 0;
  overflow-x:auto;
}

/* 注意点 */
.tips {
  background:#f0fdf4;
  border-left:3px solid #16a34a;
  padding:10px 14px;
  border-radius:4px;
  font-size:14px;
}
.tips ul { margin:6px 0; padding-left:22px; }

/* 結果ヘッダ */
.result-head {
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:16px;
}
.result-actions { white-space:nowrap; }

/* ===== 手順書プレビュー ===== */
.manual-preview {
  background:#fafafa;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:18px 22px;
  margin-top:10px;
  max-height:600px;
  overflow:auto;
  font-size:14px;
  line-height:1.7;
}
.manual-preview h1 { font-size:22px; margin-top:8px; color:#1e3a8a; }
.manual-preview h2 { font-size:18px; margin-top:18px; color:#1e3a8a;
  border-bottom:1px solid #e5e7eb; padding-bottom:4px; }
.manual-preview h3 { font-size:16px; margin-top:14px; color:#374151; }
.manual-preview h4 { font-size:14px; margin-top:10px; color:#6b7280; }
.manual-preview ul, .manual-preview ol { padding-left:22px; }
.manual-preview code {
  background:#f3f4f6; padding:1px 4px; border-radius:3px; font-size:13px;
}
.manual-preview pre {
  background:#1f2937; color:#e5e7eb; padding:12px; border-radius:6px;
  overflow:auto; font-size:13px;
}

/* ===== タスク（チェックリスト） ===== */
.task-card {
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:14px 16px;
  margin-bottom:10px;
}
.task-card-head {
  display:flex; justify-content:space-between; align-items:center;
}
.task-card-title { font-weight:600; color:#1e3a8a; }
.task-card-meta { font-size:13px; color:#6b7280; }
.progress-bar {
  height:8px; background:#e5e7eb; border-radius:4px; overflow:hidden;
  margin-top:6px;
}
.progress-bar-fill {
  height:100%; background:#3b82f6; transition:width 0.3s;
}

.checklist-item {
  display:flex; align-items:flex-start; gap:10px;
  padding:10px 12px;
  border:1px solid #e5e7eb;
  border-radius:6px;
  margin-bottom:6px;
  background:#fff;
}
.checklist-item.done {
  background:#f0fdf4; border-color:#86efac;
  opacity:0.85;
}
.checklist-item.done .ci-title {
  text-decoration:line-through;
  color:#6b7280;
}
.checklist-item input[type="checkbox"] {
  width:18px; height:18px; margin-top:2px; cursor:pointer;
}
.ci-body { flex:1; }
.ci-title { font-weight:500; }
.ci-meta { font-size:12px; color:#6b7280; margin-top:2px; }
.ci-desc { font-size:13px; color:#374151; margin-top:4px; }
.ci-notes {
  margin-top:6px; padding:6px 8px;
  background:#fffbeb; border-left:3px solid #f59e0b;
  font-size:12px; border-radius:4px;
}
.ci-comment-area {
  display:none;
  margin-top:8px;
  background:#f9fafb; padding:8px 10px;
  border-radius:4px;
}
.ci-comment-area.show { display:block; }
.ci-comment-area textarea {
  width:100%; min-height:50px; font-size:13px;
}
.ci-comment-area .row {
  display:flex; gap:6px; align-items:center; margin-top:6px;
}
.ci-comment-area input[type=number] {
  width:80px; padding:4px 6px; border:1px solid #d1d5db; border-radius:4px;
}

/* ステータスバッジ */
.status-badge {
  display:inline-block; font-size:12px; padding:2px 8px;
  border-radius:10px;
}
.status-pending     { background:#e5e7eb; color:#374151; }
.status-in_progress { background:#dbeafe; color:#1e40af; }
.status-done        { background:#dcfce7; color:#166534; }
.status-completed   { background:#dcfce7; color:#166534; }
