/* 양식정보 모달 (.mf-*) — 2026-08-18
   member_forms/_content·_list·_form_modal·_groups_modal + member_forms*_controller 짝.
   규칙 10: 폼 컨트롤은 배경·글자색 함께 지정. */

.mf-root { display: flex; flex-direction: column; height: 100%; padding: 14px 16px; box-sizing: border-box; }

/* ── 툴바 ── */
.mf-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex-shrink: 0; margin-bottom: 10px; }
.mf-search {
  flex: 1; min-width: 160px; padding: 7px 10px;
  border: 1px solid #d1d5db; border-radius: 7px; font-size: 13px;
  background: #fff; color: #111827; box-sizing: border-box;
}
.mf-select {
  padding: 7px 8px; border: 1px solid #d1d5db; border-radius: 7px; font-size: 12px;
  background: #fff; color: #111827; box-sizing: border-box; max-width: 220px;
}
.mf-member-select { font-weight: 600; }

/* ── 버튼 ── */
.mf-btn {
  padding: 7px 12px; border: 1px solid #d1d5db; border-radius: 7px;
  background: #fff; color: #374151; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.mf-btn:hover { background: #f8fafc; }
.mf-btn-primary { background: #3e6187; border-color: #3e6187; color: #fff; }
.mf-btn-primary:hover { background: #345273; }
.mf-btn-danger { color: #dc2626; border-color: #fca5a5; }
.mf-btn-danger:hover { background: #fef2f2; }
.mf-btn-copy { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.mf-btn-copy:hover { background: #dbeafe; }

/* ── 그룹 칩 ── */
.mf-groupbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mf-chip {
  padding: 5px 12px; border: 1px solid #e5e7eb; border-radius: 14px;
  background: #fff; color: #64748b; font-size: 12px; font-weight: 600; cursor: pointer;
}
.mf-chip:hover { background: #f8fafc; }
.mf-chip.active { background: #3e6187; border-color: #3e6187; color: #fff; }
.mf-chip-manage { border-style: dashed; color: #94a3b8; }

/* ── 본문/카드 ── */
.mf-body { flex: 1; min-height: 0; overflow-y: auto; }
.mf-empty { padding: 48px 16px; text-align: center; color: #94a3b8; font-size: 13px; line-height: 1.7; }
.mf-cards { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
/* 여러열 배치 — 토글은 재렌더에도 살아남는 .mf-body 에 건다 */
.mf-body.mf-layout-multi .mf-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  align-items: start;
}

/* ── 카드 배치 토글 ── */
.mf-layout-toggle { display: inline-flex; gap: 2px; padding: 3px; background: #f3f4f6; border-radius: 8px; }
.mf-layout-btn {
  width: 28px; height: 26px; border: none; border-radius: 6px; background: transparent;
  color: #94a3b8; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.mf-layout-btn.active { background: #fff; color: #3e6187; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.mf-card { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; padding: 12px 14px; }
.mf-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mf-card-title { font-size: 13px; font-weight: 700; color: #111827; }
.mf-card-group {
  font-size: 10px; font-weight: 700; color: #3e6187; background: #e7eef6;
  padding: 2px 8px; border-radius: 9px;
}
.mf-card-meta { margin-left: auto; font-size: 11px; color: #94a3b8; }

.mf-card-body {
  margin-top: 8px; font-size: 12.5px; color: #374151; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mf-card-body.expanded { display: block; -webkit-line-clamp: unset; overflow: visible; }
/* 미리보기 중 — 치환본 표시임을 배경으로 표시 */
.mf-card.mf-previewing .mf-card-body {
  background: #f0fdfa; border: 1px dashed #99f6e4; border-radius: 8px; padding: 8px 10px;
}

/* 연락처 후보 칩 (컨텍스트 바) */
.mf-tel-chip { font-size: 11px; }
.mf-tel-chip:disabled { cursor: default; }
.mf-tel-chip.active { background: #0f766e; border-color: #0f766e; color: #fff; }

/* ── 썸네일 ── */
.mf-thumbs, .mf-edit-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mf-thumb { position: relative; display: inline-block; }
.mf-thumb img {
  width: 74px; height: 74px; object-fit: cover; border-radius: 8px;
  border: 1px solid #e5e7eb; display: block; background: #f8fafc;
}
.mf-thumb-copy, .mf-thumb-remove {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  font-size: 11px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.mf-thumb-copy:hover { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.mf-thumb-remove { color: #dc2626; }
.mf-thumb-remove:hover { background: #fef2f2; border-color: #fca5a5; }

.mf-card-actions { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.mf-card-actions-right { margin-left: auto; display: inline-flex; gap: 4px; }
.mf-icon-btn {
  width: 28px; height: 28px; border: 1px solid #e5e7eb; border-radius: 7px;
  background: #fff; color: #64748b; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mf-icon-btn:hover { background: #f8fafc; color: #374151; }
.mf-icon-danger:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }

/* ── 등록/수정 모달 ── */
.mf-edit-body { padding: 18px; }
.mf-field-label { display: block; margin: 12px 0 5px; font-size: 12px; font-weight: 700; color: #374151; }
.mf-field-label:first-child { margin-top: 0; }
.mf-input {
  width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 7px;
  font-size: 13px; background: #fff; color: #111827; box-sizing: border-box;
}
.mf-textarea { resize: vertical; min-height: 140px; font-family: inherit; line-height: 1.6; }
.mf-hint { margin: 8px 0 0; font-size: 11px; color: #94a3b8; line-height: 1.6; }
.mf-edit-thumbs { margin: 0 0 10px; }
.mf-edit-thumbs:empty { margin: 0; }

/* ── 변수 치환 컨텍스트 바 ── */
.mf-ctxbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.mf-ctx-display { font-size: 12px; font-weight: 700; color: #0f766e; }
.mf-ctx-display.active { padding: 4px 10px; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 7px; }
.mf-ctx-hint { font-size: 11px; color: #94a3b8; }

/* ── 변수 칩 (등록/수정 모달) ── */
.mf-varchips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.mf-varchips .mf-chip { font-family: ui-monospace, monospace; font-size: 11px; padding: 3px 9px; }

/* ── SMS 버튼 ── */
.mf-btn-sms { border-color: #fcd34d; background: #fef3c7; color: #92400e; }
.mf-btn-sms:hover { background: #fde68a; }

/* ── 고객 선택 모달 ── */
.mf-picker-body { padding: 18px; }
.mf-picker-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.mf-picker-results { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow-y: auto; }
.mf-picker-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; cursor: pointer;
}
.mf-picker-row:hover { background: #f0f9ff; border-color: #bfdbfe; }
.mf-picker-name { flex-shrink: 0; min-width: 64px; font-size: 13px; font-weight: 700; color: #111827; }
.mf-picker-tel { flex-shrink: 0; font-size: 12px; color: #475569; }
.mf-picker-campaign { flex: 1; min-width: 0; font-size: 11px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-picker-manager { flex-shrink: 0; font-size: 11px; color: #3e6187; }
.mf-picker-date { flex-shrink: 0; margin-left: auto; font-size: 11px; color: #94a3b8; }
.mf-picker-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.mf-picker-pager .mf-btn:disabled { opacity: 0.4; cursor: default; }
.mf-picker-pageinfo { font-size: 12px; color: #64748b; }

/* ── 양식 전달 / 수신함 ── */
.mf-inbox-btn { border-color: #99f6e4; background: #f0fdfa; color: #0f766e; }
.mf-inbox-btn:hover { background: #ccfbf1; }
.mf-inbox-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 3px;
  background: #0f766e; color: #fff; border-radius: 9px; font-size: 10px; font-weight: 700;
}
.mf-transfer-body { padding: 18px; }
.mf-transfer-form { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.mf-transfer-all { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #374151; margin: 10px 0 6px; cursor: pointer; }
.mf-transfer-members {
  display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto;
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 6px;
}
.mf-transfer-member {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  font-size: 13px; color: #111827; border-radius: 6px; cursor: pointer;
}
.mf-transfer-member:hover { background: #f8fafc; }
.mf-inbox-body { padding: 18px; }
.mf-inbox-item { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; padding: 12px 14px; margin-bottom: 10px; }
.mf-inbox-actions { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.mf-inbox-actions .mf-select { max-width: 160px; }

/* ── 그룹 관리 모달 ── */
.mf-groups-body { padding: 18px; }
.mf-group-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.mf-group-row .mf-input { flex: 1; }
.mf-group-add { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e5e7eb; }

/* ── 다크모드 (개발자 전용 자체 다크) ── */
html.dark .mf-search, html.dark .mf-select, html.dark .mf-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.dark .mf-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
html.dark .mf-btn-primary { background: #3e6187; border-color: #3e6187; color: #fff; }
html.dark .mf-chip { background: #1e293b; border-color: #334155; color: #94a3b8; }
html.dark .mf-chip.active { background: #3e6187; border-color: #3e6187; color: #fff; }
html.dark .mf-card { background: #1e293b; border-color: #334155; }
html.dark .mf-card-title { color: #e2e8f0; }
html.dark .mf-card-body { color: #cbd5e1; }
