.fo-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
.fo-modal-overlay.active { display: flex; }

.fo-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 480px;
  width: 90%;
  overflow: hidden;
  animation: foModalIn 0.2s ease-out;
}

@keyframes foModalIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fo-modal-header {
  background: #E3F2FD;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #BBDEFB;
  position: relative;
}

.fo-modal-icon { font-size: 24px; flex-shrink: 0; }

.fo-modal-title {
  margin: 0;
  color: #1565C0;
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}

.fo-modal-close {
  position: absolute;
  right: 14px; top: 14px;
  background: none; border: none;
  font-size: 22px; color: #666;
  cursor: pointer;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.fo-modal-close:hover { background: rgba(0,0,0,0.06); }

.fo-modal-body {
  padding: 22px 24px;
  color: #333;
  font-size: 14px;
  line-height: 1.7;
}

.fo-modal-message { margin: 0; white-space: pre-line; }

.fo-modal-details {
  margin: 14px 0 0;
  padding: 12px 16px;
  background: #F5F9FC;
  border-left: 3px solid #29B6F6;
  border-radius: 4px;
  list-style: none;
}
.fo-modal-details li {
  padding: 4px 0;
  font-weight: 500;
  color: #1565C0;
  font-size: 13px;
}

.fo-modal-footer {
  padding: 14px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #ECEFF1;
  background: #FAFBFC;
}

.fo-btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-width: 80px;
  transition: background 0.15s;
}

.fo-btn-cancel  { background: #ECEFF1; color: #546E7A; }
.fo-btn-cancel:hover  { background: #CFD8DC; }
.fo-btn-confirm { background: #29B6F6; color: #fff; }
.fo-btn-confirm:hover { background: #0288D1; }

/* type별 컬러 변형 */
.fo-modal.warning  .fo-modal-header { background: #FFF3E0; border-bottom-color: #FFE0B2; }
.fo-modal.warning  .fo-modal-title  { color: #E65100; }
.fo-modal.error    .fo-modal-header { background: #FFEBEE; border-bottom-color: #FFCDD2; }
.fo-modal.error    .fo-modal-title  { color: #C62828; }
.fo-modal.success  .fo-modal-header { background: #E8F5E9; border-bottom-color: #C8E6C9; }
.fo-modal.success  .fo-modal-title  { color: #2E7D32; }

/* 팜오더 커스텀 툴팁 */
.farm-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
}

.farm-tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  width: 240px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  white-space: normal;
}

.farm-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
}

.farm-tooltip-wrap:hover .farm-tooltip-content {
  opacity: 1;
  visibility: visible;
}

/* data-tooltip / data-tooltip-long 검정 말풍선 */
[data-tooltip],
[data-tooltip-long] {
  position: relative;
}
[data-tooltip]::after,
[data-tooltip-long]::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 10000;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  white-space: nowrap;
}
[data-tooltip-long]::after {
  content: attr(data-tooltip-long);
  white-space: normal;
  width: 280px;
  text-align: left;
}
[data-tooltip]::before,
[data-tooltip-long]::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 10000;
  pointer-events: none;
}
[data-tooltip]:hover::after,
[data-tooltip-long]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip-long]:hover::before {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   Tippy.js 메모지 옐로 테마 (작업 003)
   사용법: data-tippy-content="안내 메시지" 속성 부여
   ============================================================ */
.tippy-box[data-theme~='farm-yellow'] {
  background-color: #fef3c7;
  color: #78350f;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  padding: 2px 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-weight: 400;
}

.tippy-box[data-theme~='farm-yellow'] .tippy-content {
  padding: 7px 10px;
}

.tippy-box[data-theme~='farm-yellow'][data-placement^='top'] > .tippy-arrow::before {
  border-top-color: #fef3c7;
}
.tippy-box[data-theme~='farm-yellow'][data-placement^='bottom'] > .tippy-arrow::before {
  border-bottom-color: #fef3c7;
}
.tippy-box[data-theme~='farm-yellow'][data-placement^='left'] > .tippy-arrow::before {
  border-left-color: #fef3c7;
}
.tippy-box[data-theme~='farm-yellow'][data-placement^='right'] > .tippy-arrow::before {
  border-right-color: #fef3c7;
}
