/* ============================================================
 * JOYN Form — Frontend Admin (v1.3.0+)
 * 프론트엔드 관리 페이지 스타일 (wp-admin 없이 동작)
 *
 * 디자인 시스템:
 *   - Indigo #4541FF (Solapi)
 *   - Pretendard 폰트
 *   - Remix Icons
 *   - jfa- 접두사로 모든 클래스 격리 (theme 충돌 방지)
 * ============================================================ */

.jfa-wrap, .jfa-wrap * { box-sizing: border-box; }
.jfa-wrap {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', -apple-system, sans-serif;
  color: #0F172A;
  line-height: 1.6;
  background: #fff;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

/* ============ Header ============ */
.jfa-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid #E2E8F0;
}
.jfa-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #4541FF;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.jfa-h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 10px;
}
.jfa-h1 i { color: #4541FF; }
.jfa-h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}
.jfa-h2 i { color: #4541FF; font-size: 18px; }
.jfa-h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 10px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}
.jfa-header-actions { display: flex; gap: 8px; }

/* ============ Buttons ============ */
.jfa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid #CBD5E1;
  background: #fff;
  color: #475569;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.12s;
}
.jfa-btn:hover { border-color: #4541FF; color: #4541FF; background: #fff; text-decoration: none; }
.jfa-btn-primary { background: #4541FF; border-color: #4541FF; color: #fff; }
.jfa-btn-primary:hover { background: #3633E0; border-color: #3633E0; color: #fff; }
.jfa-btn-ghost { background: transparent; border-color: transparent; color: #64748B; }
.jfa-btn-ghost:hover { background: #F1F5F9; border-color: transparent; }
.jfa-btn-sm { padding: 5px 10px; font-size: 12px; }
.jfa-btn-hero { padding: 14px 22px; font-size: 14px; }
.jfa-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ Auth Required Card ============ */
.jfa-auth-required { display: flex; align-items: center; justify-content: center; min-height: 420px; }
.jfa-auth-card {
  text-align: center;
  padding: 40px 32px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  max-width: 380px;
  width: 100%;
}
.jfa-auth-icon { font-size: 48px; color: #4541FF; display: block; margin-bottom: 16px; }
.jfa-auth-card h2 { font-size: 20px; font-weight: 700; margin: 0 0 8px; color: #0F172A; }
.jfa-auth-card p { color: #64748B; margin: 0 0 22px; font-size: 14px; }

/* ============ Dashboard ============ */
.jfa-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.jfa-stat-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.15s;
}
.jfa-stat-card:hover { border-color: #C7D2FE; box-shadow: 0 4px 12px rgba(15,23,42,0.05); }
.jfa-stat-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.jfa-stat-warn    { background: #FEF3C7; color: #B45309; }
.jfa-stat-info    { background: #E0F2FE; color: #0369A1; }
.jfa-stat-success { background: #D1FAE5; color: #047857; }
.jfa-stat-indigo  { background: #EEF2FF; color: #4541FF; }
.jfa-stat-label { font-size: 12px; color: #64748B; margin-bottom: 2px; font-weight: 500; }
.jfa-stat-value { font-size: 22px; font-weight: 800; color: #0F172A; line-height: 1.1; letter-spacing: -0.02em; }

.jfa-quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.jfa-quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 11px;
  text-decoration: none;
  color: #0F172A;
  transition: all 0.15s;
}
.jfa-quick-card:hover { border-color: #4541FF; transform: translateY(-1px); box-shadow: 0 6px 14px rgba(69,65,255,0.1); text-decoration: none; }
.jfa-quick-card i { font-size: 22px; color: #4541FF; margin-bottom: 8px; }
.jfa-quick-card span { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.jfa-quick-card small { font-size: 11.5px; color: #94A3B8; font-weight: 500; }
.jfa-card-accent { background: linear-gradient(135deg, #4541FF, #5957FF); border-color: #4541FF; color: #fff; }
.jfa-card-accent i, .jfa-card-accent span, .jfa-card-accent small { color: #fff; }
.jfa-card-accent small { opacity: 0.85; }

/* ============ Layout (Split) ============ */
.jfa-layout-split {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
}
@media (max-width: 820px) { .jfa-layout-split { grid-template-columns: 1fr; } }

.jfa-sidebar {
  background: #FBFCFE;
  border: 1px solid #E2E8F0;
  border-radius: 11px;
  padding: 12px 8px;
  height: fit-content;
}
.jfa-sidebar-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  padding: 6px 10px 10px;
}
.jfa-side-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: 7px;
  color: #475569;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.12s;
}
.jfa-side-item:hover { background: #F1F5F9; color: #0F172A; text-decoration: none; }
.jfa-side-item.active { background: #EEF2FF; color: #4541FF; font-weight: 600; }
.jfa-side-item i { font-size: 14px; opacity: 0.7; flex-shrink: 0; }
.jfa-side-item.active i { opacity: 1; color: #4541FF; }
.jfa-side-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.jfa-main {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 11px;
  padding: 20px;
  min-height: 480px;
}
.jfa-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}

/* ============ Tabs ============ */
.jfa-status-tabs, .jfa-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
}
.jfa-tab, .jfa-status-tab {
  padding: 8px 14px;
  color: #64748B;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 7px 7px 0 0;
  border-bottom: 2px solid transparent;
  transition: all 0.12s;
  display: inline-flex; align-items: center; gap: 6px;
}
.jfa-tab:hover { color: #0F172A; text-decoration: none; }
.jfa-tab.active { color: #4541FF; border-bottom-color: #4541FF; font-weight: 600; }
.jfa-tab-count { background: #F1F5F9; padding: 1px 7px; border-radius: 9px; font-size: 11px; }
.jfa-tab.active .jfa-tab-count { background: #EEF2FF; color: #4541FF; }
.jfa-tab-body { padding: 16px 0; }

/* ============ Tables ============ */
.jfa-table-wrap { overflow-x: auto; }
.jfa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.jfa-table th, .jfa-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #F1F5F9;
}
.jfa-table th {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #FAFBFD;
}
.jfa-table tr:last-child td { border-bottom: 0; }
.jfa-table tr:hover { background: #FAFBFD; }
.jfa-table code { background: #F1F5F9; color: #475569; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; }
.jfa-empty-cell { text-align: center; padding: 36px 12px; color: #94A3B8; font-size: 13px; }

/* ============ Pills (status) ============ */
.jfa-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 5px;
}
.jfa-pill-pending    { background: #FEF3C7; color: #92400E; }
.jfa-pill-reviewing  { background: #DBEAFE; color: #1E40AF; }
.jfa-pill-approved, .jfa-pill-confirmed, .jfa-pill-attended { background: #D1FAE5; color: #065F46; }
.jfa-pill-rejected, .jfa-pill-cancelled  { background: #FEE2E2; color: #991B1B; }
.jfa-pill-scheduled  { background: #EDE9FE; color: #5B21B6; }
.jfa-pill-waitlist   { background: #FCE7F3; color: #9D174D; }

/* ============ Entries (Inbox) ============ */
.jfa-entries-list { display: flex; flex-direction: column; gap: 4px; }
.jfa-entry-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.12s;
}
.jfa-entry-row:hover { background: #F8FAFC; }
.jfa-avatar {
  width: 38px; height: 38px;
  background: #EEF2FF;
  color: #4541FF;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.jfa-entry-info { flex: 1; min-width: 0; }
.jfa-entry-head { display: flex; gap: 8px; align-items: baseline; margin-bottom: 2px; }
.jfa-entry-head strong { color: #0F172A; font-size: 14px; }
.jfa-entry-email { font-size: 12px; color: #94A3B8; }
.jfa-entry-meta { font-size: 11.5px; color: #94A3B8; display: flex; gap: 12px; }
.jfa-entry-meta i { font-size: 13px; }
.jfa-entry-actions { display: flex; gap: 6px; align-items: center; }

/* ============ Empty State ============ */
.jfa-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94A3B8;
}
.jfa-empty i { font-size: 40px; display: block; margin-bottom: 10px; opacity: 0.5; }
.jfa-empty p { margin: 0; font-size: 14px; }

/* ============ Builder ============ */
.jfa-builder-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.jfa-shortcode-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 5px 5px 5px 12px;
}
.jfa-shortcode-pill code {
  font-size: 12px; color: #4541FF; background: transparent; padding: 0;
}

.jfa-actions-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .jfa-actions-cols { grid-template-columns: 1fr; } }
.jfa-action-item {
  display: flex; gap: 10px;
  padding: 10px 12px;
  background: #FBFCFE;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-bottom: 6px;
}
.jfa-action-item.jfa-action-reject { background: #FFF5F5; border-color: #FECACA; }
.jfa-action-num {
  width: 22px; height: 22px;
  background: #4541FF; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.jfa-action-item.jfa-action-reject .jfa-action-num { background: #EF4444; }
.jfa-action-item strong { font-size: 13px; }
.jfa-action-item strong i { color: #4541FF; margin-right: 4px; }

.jfa-channels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.jfa-channel-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  background: #FBFCFE;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  opacity: 0.5;
}
.jfa-channel-card.active { opacity: 1; border-color: #4541FF; background: #EEF2FF; }
.jfa-channel-card i { font-size: 20px; color: #4541FF; }
.jfa-channel-card strong { font-size: 13px; display: block; }

.jfa-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .jfa-form-grid { grid-template-columns: 1fr; } }
.jfa-label { display: block; font-size: 11.5px; font-weight: 600; color: #64748B; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.jfa-value { font-size: 14px; color: #0F172A; }
.jfa-value code { background: #F1F5F9; color: #4541FF; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.jfa-type-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  background: #EEF2FF;
  color: #4541FF;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.jfa-muted { color: #94A3B8; font-size: 12.5px; }

.jfa-preview-frame {
  background: #FAFBFD;
  border: 1px dashed #CBD5E1;
  border-radius: 10px;
  padding: 20px;
}

/* ============ Check-in (mobile-first) ============ */
.jfa-checkin { max-width: 680px; }
.jfa-checkin-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}
.jfa-checkin-intro p { color: #64748B; font-size: 13.5px; margin: 0 0 18px; }
.jfa-checkin-scanner {
  padding: 22px;
  background: #FAFBFD;
  border-radius: 11px;
  text-align: center;
  margin-bottom: 14px;
}
#jfa-camera-preview { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#jfa-video-stream {
  width: 100%; max-width: 480px;
  border-radius: 11px;
  background: #000;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.jfa-checkin-divider {
  text-align: center;
  position: relative;
  margin: 16px 0;
  color: #94A3B8;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.jfa-checkin-divider::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid #E2E8F0;
  z-index: 0;
}
.jfa-checkin-divider span { background: #fff; padding: 0 12px; position: relative; }

.jfa-checkin-manual { margin-bottom: 16px; }
.jfa-input-row { display: flex; gap: 6px; }
.jfa-input-row input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid #CBD5E1;
  border-radius: 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  outline: none;
}
.jfa-input-row input:focus { border-color: #4541FF; box-shadow: 0 0 0 3px rgba(69,65,255,0.08); }

#jfa-checkin-result {
  padding: 14px;
  border-radius: 9px;
  margin: 14px 0;
  display: none;
}
#jfa-checkin-result.success { background: #D1FAE5; color: #065F46; display: block; border-left: 4px solid #10B981; }
#jfa-checkin-result.warn    { background: #FEF3C7; color: #92400E; display: block; border-left: 4px solid #F59E0B; }
#jfa-checkin-result.fail    { background: #FEE2E2; color: #991B1B; display: block; border-left: 4px solid #EF4444; }
.jfa-result-icon { font-size: 22px; margin-right: 8px; vertical-align: -4px; }
.jfa-result-name { font-size: 16px; font-weight: 700; }
.jfa-result-meta { font-size: 12px; opacity: 0.85; margin-top: 4px; }

.jfa-checkin-history { margin-top: 18px; padding-top: 16px; border-top: 1px solid #F1F5F9; }
.jfa-checkin-log { list-style: none; padding: 0; margin: 0; max-height: 240px; overflow-y: auto; }
.jfa-checkin-log li {
  padding: 8px 10px;
  font-size: 12.5px;
  border-bottom: 1px solid #F1F5F9;
  display: flex; justify-content: space-between; align-items: center;
}
.jfa-checkin-log li.ok::before   { content: '✓'; color: #10B981; margin-right: 8px; font-weight: 700; }
.jfa-checkin-log li.dup::before  { content: '!'; color: #F59E0B; margin-right: 8px; font-weight: 700; }
.jfa-checkin-log li.fail::before { content: '×'; color: #EF4444; margin-right: 8px; font-weight: 700; }
.jfa-checkin-log li code { font-size: 10.5px; color: #94A3B8; }

/* ============ My Entries (User Page) ============ */
.jfa-my-section { margin-bottom: 32px; }
.jfa-ticket-order {
  background: #FBFCFE;
  border: 1px solid #E2E8F0;
  border-radius: 11px;
  padding: 16px;
  margin-bottom: 12px;
}
.jfa-ticket-order-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap; gap: 8px;
}
.jfa-ticket-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.jfa-ticket-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  padding: 12px;
  text-align: center;
}
.jfa-ticket-card img { width: 100%; max-width: 140px; margin: 0 auto 8px; display: block; }
.jfa-ticket-name { font-size: 13px; font-weight: 600; }
.jfa-ticket-code { font-size: 10.5px; color: #94A3B8; font-family: 'JetBrains Mono', monospace; margin-top: 3px; }
.jfa-ticket-used { font-size: 10.5px; color: #94A3B8; margin-top: 6px; }

/* ============ Modal ============ */
.jfa-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.jfa-modal.show { display: flex; }
.jfa-modal-card {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 25px 50px rgba(15,23,42,0.25);
}
.jfa-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 16px;
}
.jfa-modal-title { font-size: 17px; font-weight: 700; margin: 0; color: #0F172A; }
.jfa-modal-close {
  background: transparent; border: 0; cursor: pointer;
  font-size: 22px; color: #94A3B8; padding: 4px;
  border-radius: 6px;
}
.jfa-modal-close:hover { background: #F1F5F9; color: #0F172A; }
.jfa-modal-body { padding: 6px 0; }
.jfa-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding-top: 14px;
  border-top: 1px solid #F1F5F9;
  margin-top: 16px;
}

.jfa-data-list { background: #F8FAFC; border-radius: 8px; padding: 14px; }
.jfa-data-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid #E2E8F0; }
.jfa-data-row:last-child { border-bottom: 0; }
.jfa-data-row strong { color: #475569; font-weight: 600; font-size: 12.5px; }

/* ============ Toast ============ */
.jfa-toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: #0F172A;
  color: #fff;
  padding: 12px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 99998;
  transform: translateY(120%);
  transition: transform 0.25s;
  max-width: 320px;
}
.jfa-toast.show { transform: translateY(0); }
.jfa-toast.success { background: #047857; }
.jfa-toast.error { background: #B91C1C; }

/* ============ Slot Creator Modal ============ */
.jfa-slot-creator h3 { margin: 14px 0 8px; font-size: 13px; color: #475569; }
.jfa-slot-creator input[type="date"],
.jfa-slot-creator input[type="text"],
.jfa-slot-creator input[type="number"] {
  padding: 8px 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 7px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
}
.jfa-slot-creator input:focus { border-color: #4541FF; }
.jfa-weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.jfa-weekdays label {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border: 1.5px solid #CBD5E1;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: #64748B;
  transition: all 0.12s;
}
.jfa-weekdays label.active {
  border-color: #4541FF;
  background: #EEF2FF;
  color: #4541FF;
}
.jfa-date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ============ Animations ============ */
@keyframes jfa-spin { to { transform: rotate(360deg); } }
.ri-spin { animation: jfa-spin 1s linear infinite; display: inline-block; }

/* ============================================================
 * v1.4.0+ 빌더 전용 스타일 - 인터랙티브 폼 빌더
 * ============================================================ */

/* 빌더 헤더 우측 도구 */
.jfa-builder-toolbar { display: flex; align-items: center; gap: 10px; }
.jfa-dirty-indicator {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600;
  color: #F59E0B;
  padding: 4px 9px;
  background: #FEF3C7;
  border-radius: 5px;
}
.jfa-dirty-indicator i { font-size: 7px; }

#jfa-builder-save:not(:disabled) {
  box-shadow: 0 4px 12px rgba(69,65,255,0.25);
  animation: jfa-pulse-save 2s ease-in-out infinite;
}
@keyframes jfa-pulse-save {
  0%, 100% { box-shadow: 0 4px 12px rgba(69,65,255,0.25); }
  50% { box-shadow: 0 6px 18px rgba(69,65,255,0.4); }
}

/* ============ 일반 탭 — 인라인 편집 ============ */
.jfa-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 720px) { .jfa-edit-grid { grid-template-columns: 1fr; } }
.jfa-edit-field { display: flex; flex-direction: column; gap: 6px; }
.jfa-edit-full { grid-column: 1 / -1; }
.jfa-input {
  padding: 9px 12px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  color: #0F172A;
  background: #fff;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}
.jfa-input:focus { border-color: #4541FF; box-shadow: 0 0 0 3px rgba(69,65,255,0.08); }
.jfa-input:disabled { background: #F1F5F9; color: #94A3B8; cursor: not-allowed; }
textarea.jfa-input { resize: vertical; min-height: 60px; }
.jfa-input.jfa-input-error { border-color: #DC2626 !important; box-shadow: 0 0 0 2px rgba(220,38,38,0.12); }
select.jfa-input { cursor: pointer; }
.jfa-checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; color: #475569; padding: 10px 0; }
.jfa-checkbox input { width: 17px; height: 17px; accent-color: #4541FF; cursor: pointer; }

/* ============ 필드 빌더 — 3컬럼 ============ */
.jfa-fields-builder {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) { .jfa-fields-builder { grid-template-columns: 180px minmax(0, 1fr); } .jfa-field-editor { grid-column: 1 / -1; } }
@media (max-width: 720px) { .jfa-fields-builder { grid-template-columns: 1fr; } }

.jfa-field-palette {
  background: #FBFCFE;
  border: 1px solid #E2E8F0;
  border-radius: 11px;
  padding: 12px 10px;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.jfa-palette-title {
  font-size: 10.5px; font-weight: 700;
  color: #64748B; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 6px 10px;
}
.jfa-palette-list { display: flex; flex-direction: column; gap: 3px; }
.jfa-palette-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 12.5px;
  color: #475569;
  cursor: grab;
  transition: all 0.12s;
  user-select: none;
}
.jfa-palette-item:hover { background: #EEF2FF; border-color: #C7D2FE; color: #4541FF; transform: translateX(2px); }
.jfa-palette-item:active { cursor: grabbing; }
.jfa-palette-item.dragging { opacity: 0.5; }
.jfa-palette-item i { font-size: 14px; color: #4541FF; flex-shrink: 0; }
.jfa-palette-hint {
  margin-top: 12px;
  padding: 8px 10px;
  background: #FEF3C7;
  border-radius: 7px;
  font-size: 11px;
  color: #92400E;
  display: flex; gap: 5px; align-items: flex-start;
}
.jfa-palette-hint i { color: #B45309; flex-shrink: 0; margin-top: 1px; }

/* 필드 리스트 */
.jfa-field-list-wrap { min-width: 0; }
.jfa-field-list-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 6px; }
.jfa-field-list-head h3 { margin: 0; }
.jfa-field-list {
  background: #fff;
  border: 2px dashed #CBD5E1;
  border-radius: 11px;
  padding: 8px;
  min-height: 320px;
}
.jfa-field-list.dragover { border-color: #4541FF; background: #EEF2FF; }
.jfa-field-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94A3B8;
}
.jfa-field-empty i { font-size: 36px; display: block; margin-bottom: 10px; opacity: 0.4; }
.jfa-field-empty p { margin: 0; font-size: 13px; }

.jfa-field-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.jfa-field-item:hover { border-color: #C7D2FE; box-shadow: 0 2px 6px rgba(15,23,42,0.04); }
.jfa-field-item.selected { border-color: #4541FF; background: #EEF2FF; box-shadow: 0 0 0 3px rgba(69,65,255,0.08); }
.jfa-field-item.dragging { opacity: 0.4; }
.jfa-field-item.drop-above { border-top: 3px solid #4541FF; margin-top: -2px; padding-top: 10px; }
.jfa-field-item.drop-below { border-bottom: 3px solid #4541FF; margin-bottom: -2px; padding-bottom: 10px; }

.jfa-field-handle {
  color: #CBD5E1;
  cursor: grab;
  font-size: 18px;
  display: flex;
  align-items: center;
  padding: 0 2px;
}
.jfa-field-handle:hover { color: #4541FF; }
.jfa-field-item.dragging .jfa-field-handle { cursor: grabbing; }

.jfa-field-summary { flex: 1; min-width: 0; }
.jfa-field-type-row { display: flex; gap: 5px; margin-bottom: 4px; align-items: center; }
.jfa-required-tag { font-size: 9.5px; padding: 1px 6px; background: #FEE2E2; color: #991B1B; border-radius: 3px; font-weight: 700; }
.jfa-field-label { font-size: 13.5px; font-weight: 600; color: #0F172A; }
.jfa-field-name { font-size: 11px; color: #94A3B8; margin-top: 2px; }
.jfa-field-name code { background: transparent; padding: 0; font-size: 10.5px; color: #64748B; }
.jfa-field-actions { display: flex; gap: 3px; }
.jfa-icon-btn {
  background: transparent; border: 0; cursor: pointer;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  color: #94A3B8;
  font-size: 14px;
  transition: all 0.12s;
}
.jfa-icon-btn:hover { background: #FEE2E2; color: #DC2626; }

/* 필드 편집 패널 */
.jfa-field-editor {
  background: #FBFCFE;
  border: 1px solid #E2E8F0;
  border-radius: 11px;
  padding: 16px;
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.jfa-field-editor-empty {
  text-align: center;
  padding: 30px 20px;
  color: #94A3B8;
}
.jfa-field-editor-empty i { font-size: 32px; display: block; margin-bottom: 8px; opacity: 0.5; }
.jfa-field-editor-empty p { margin: 0; font-size: 12.5px; line-height: 1.55; }
.jfa-field-editor-form { display: flex; flex-direction: column; gap: 12px; }
.jfa-field-editor-form .jfa-label { font-size: 11px; }
.jfa-field-editor-form input,
.jfa-field-editor-form textarea,
.jfa-field-editor-form select { padding: 7px 10px; font-size: 12.5px; }
.jfa-options-editor { display: flex; flex-direction: column; gap: 4px; }
.jfa-option-row { display: flex; gap: 4px; }
.jfa-option-row input { flex: 1; }
.jfa-option-row button { padding: 6px 9px; }
.jfa-add-option-btn {
  padding: 6px;
  border: 1px dashed #CBD5E1;
  background: transparent;
  color: #64748B;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.jfa-add-option-btn:hover { border-color: #4541FF; color: #4541FF; }

/* ============ 액션 빌더 ============ */
.jfa-actions-builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 820px) { .jfa-actions-builder { grid-template-columns: 1fr; } }

.jfa-actions-col { display: flex; flex-direction: column; }
.jfa-actions-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #F1F5F9;
}
.jfa-actions-col-head h3 { margin: 0; }
.jfa-actions-list {
  min-height: 200px;
  background: #FBFCFE;
  border: 2px dashed #E2E8F0;
  border-radius: 11px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.jfa-action-card {
  display: flex; gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  align-items: center;
  transition: all 0.15s;
}
.jfa-action-card:hover { border-color: #C7D2FE; box-shadow: 0 2px 6px rgba(15,23,42,0.04); }
.jfa-action-card.dragging { opacity: 0.4; }
.jfa-action-card.drop-above { border-top: 3px solid #4541FF; }
.jfa-action-card.drop-below { border-bottom: 3px solid #4541FF; }
.jfa-action-card.jfa-action-reject { background: #FFFBFB; border-color: #FECACA; }

.jfa-action-num {
  width: 22px; height: 22px;
  background: #4541FF; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.jfa-action-reject .jfa-action-num { background: #EF4444; }
.jfa-action-body { flex: 1; min-width: 0; }
.jfa-action-title { display: flex; align-items: center; gap: 5px; }
.jfa-action-title i { color: #4541FF; }
.jfa-action-reject .jfa-action-title i { color: #EF4444; }
.jfa-action-title strong { font-size: 13px; color: #0F172A; }
.jfa-action-meta { font-size: 11px; color: #64748B; margin-top: 2px; }
.jfa-action-meta code { background: #F1F5F9; padding: 1px 5px; font-size: 10.5px; }
.jfa-action-detail { font-size: 11.5px; color: #94A3B8; margin-top: 3px; font-style: italic; }
.jfa-action-buttons { display: flex; gap: 2px; }

/* ============ 알림 빌더 ============ */
.jfa-notify-builder h3 { margin-top: 6px; }
.jfa-channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.jfa-channel-toggle {
  display: block;
  padding: 12px;
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.jfa-channel-toggle input { display: none; }
.jfa-channel-toggle:hover { border-color: #C7D2FE; }
.jfa-channel-toggle.active { border-color: #4541FF; background: #EEF2FF; }
.jfa-channel-content { display: flex; align-items: center; gap: 10px; }
.jfa-channel-content i { font-size: 22px; color: #4541FF; }
.jfa-channel-toggle:not(.active) .jfa-channel-content i { color: #94A3B8; }
.jfa-channel-content strong { display: block; font-size: 13px; }
.jfa-channel-status { font-size: 11px; color: #64748B; margin-top: 1px; }
.jfa-channel-toggle.active .jfa-channel-status { color: #10B981; font-weight: 600; }

.jfa-reminders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.jfa-reminder-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.jfa-reminder-toggle input { display: none; }
.jfa-reminder-toggle:hover { border-color: #C7D2FE; }
.jfa-reminder-toggle.active { border-color: #4541FF; background: #EEF2FF; }
.jfa-reminder-toggle i { font-size: 18px; color: #94A3B8; }
.jfa-reminder-toggle.active i { color: #4541FF; }
.jfa-reminder-toggle strong { display: block; font-size: 12.5px; color: #0F172A; }
.jfa-reminder-toggle small { display: block; font-size: 10.5px; color: #94A3B8; margin-top: 1px; }

/* ============ 미리보기 ============ */
.jfa-preview-wrap { border-radius: 11px; overflow: hidden; }
.jfa-preview-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 11px 11px 0 0;
  font-size: 12px;
  color: #64748B;
}
.jfa-preview-bar i { color: #4541FF; }
.jfa-preview-frame {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-top: 0;
  border-radius: 0 0 11px 11px;
  padding: 24px;
  min-height: 300px;
}

/* ============================================================
 * v1.4.2+ 미리보기 강화 — 디바이스 프레임 + 뷰포트 전환
 * ============================================================ */
.jfa-preview-controls { display: flex; gap: 6px; align-items: center; }
.jfa-vp-btn { padding: 5px 10px; font-size: 11.5px; }
.jfa-vp-btn.active { background: #4541FF; color: #fff; border-color: #4541FF; }
.jfa-vp-btn.active:hover { background: #3633E0; }

.jfa-preview-stage {
  background:
    linear-gradient(135deg, #F1F5F9 0%, #E2E8F0 100%),
    radial-gradient(circle at 50% 30%, rgba(69,65,255,0.05), transparent 70%);
  border: 1px solid #E2E8F0;
  border-top: 0;
  border-radius: 0 0 11px 11px;
  padding: 28px 20px;
  display: flex;
  justify-content: center;
  min-height: 480px;
  transition: padding 0.3s;
  position: relative;
}
.jfa-preview-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(15,23,42,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.025) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  border-radius: 0 0 11px 11px;
}

.jfa-preview-device {
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 1px 3px rgba(15,23,42,0.08),
    0 12px 40px rgba(15,23,42,0.12);
  overflow: hidden;
  transition: max-width 0.3s, transform 0.3s;
  position: relative;
  z-index: 1;
}
.jfa-preview-device.jfa-vp-desktop { width: 100%; max-width: 100%; }
.jfa-preview-device.jfa-vp-tablet  { width: 768px;  max-width: 100%; }
.jfa-preview-device.jfa-vp-mobile  { width: 380px;  max-width: 100%; }

.jfa-preview-device .jfa-preview-frame {
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 20px;
  min-height: 400px;
  max-height: 720px;
  overflow-y: auto;
}

/* 미리보기 안 폼이 너무 크지 않도록 — 디바이스 프레임에 맞게 */
.jfa-preview-device .jf-wrap { padding: 0; }
.jfa-preview-device .jf-hero-title { font-size: 26px; }
.jfa-preview-device .jf-hero-sub   { font-size: 14px; }
.jfa-preview-device .jf-block-title { font-size: 18px; }

.jfa-vp-mobile .jf-layout-split .jf-container,
.jfa-vp-mobile .jf-container { grid-template-columns: 1fr !important; }
.jfa-vp-mobile .jf-hero-title { font-size: 22px !important; }

/* ============================================================
 * v1.7.0+ 새 폼 생성 + 안내 HTML 빌더
 * ============================================================ */

/* 사이드바 헤더 (제목 + 새 폼 버튼) */
.jfa-sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid #F1F5F9;
}
.jfa-sidebar-head .jfa-sidebar-title { padding: 0; }
.jfa-side-badge {
  display: inline-block;
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  background: #EDE9FE;
  color: #6D28D9;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

/* Danger zone (삭제) */
.jfa-danger-zone {
  margin-top: 32px;
  padding: 18px 22px;
  background: #FFF1F2;
  border: 1px solid #FECACA;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.jfa-danger-zone strong { color: #991B1B; font-size: 13px; display: block; margin-bottom: 4px; }
.jfa-danger-zone strong i { margin-right: 4px; }
.jfa-danger-zone p { font-size: 12.5px; color: #B91C1C; margin: 0; }
.jfa-btn-danger {
  background: #DC2626; color: #fff; border-color: #DC2626;
}
.jfa-btn-danger:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; }

/* Callout */
.jfa-callout {
  display: flex; gap: 12px;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  border-left: 3px solid;
}
.jfa-callout i { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.jfa-callout-info { background: #EFF6FF; border-left-color: #2563EB; color: #1E3A8A; }
.jfa-callout-info i { color: #2563EB; }
.jfa-callout strong { display: block; margin-bottom: 3px; font-size: 13.5px; }
.jfa-callout p { margin: 0; font-size: 12.5px; line-height: 1.5; color: inherit; opacity: 0.85; }

/* HTML 빌더 toolbar */
.jfa-html-toolbar {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #FBFCFE;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  margin-bottom: 12px;
}
.jfa-html-toolbar .jfa-btn { padding: 6px 11px; font-size: 12px; }

/* HTML 에디터 split */
.jfa-html-editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}
@media (max-width: 980px) { .jfa-html-editor-split { grid-template-columns: 1fr; } }

.jfa-html-input-side,
.jfa-html-preview-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.jfa-html-code {
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace !important;
  font-size: 12.5px !important;
  line-height: 1.65;
  resize: vertical;
  min-height: 380px;
  tab-size: 2;
  background: #0F172A !important;
  color: #E2E8F0 !important;
  border-color: #1E293B !important;
}
.jfa-html-code:focus { border-color: #4541FF !important; box-shadow: 0 0 0 3px rgba(69,65,255,0.15) !important; }

.jfa-html-stats {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: #64748B;
  padding: 2px 4px;
}
.jfa-html-stats i { margin-right: 3px; }

.jfa-html-preview {
  background: #fff;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  padding: 16px;
  min-height: 380px;
  max-height: 520px;
  overflow-y: auto;
  font-family: 'Pretendard', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #0F172A;
}

.jfa-html-templates-hint {
  padding: 12px 16px;
  background: #FEF3C7;
  border-radius: 8px;
  font-size: 12.5px;
  color: #92400E;
  line-height: 1.5;
}
.jfa-html-templates-hint p { margin: 0; }
.jfa-html-templates-hint code {
  background: #FFEFD5; padding: 1px 6px; border-radius: 3px;
  color: #92400E; font-size: 11.5px;
}

.jfa-html-mode-toggle .jfa-checkbox { padding: 0; font-size: 12.5px; }

/* 새 폼 생성 모달 */
.jfa-create-form-modal .jfa-edit-grid { gap: 12px; }
.jfa-form-key-hint {
  font-size: 11.5px; color: #94A3B8;
  margin-top: 2px;
}
.jfa-form-key-hint.error { color: #DC2626; }
.jfa-form-key-hint.success { color: #059669; }

/* 폼 아이콘 선택 그리드 */
.jfa-icon-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 8px;
  background: #FBFCFE;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  max-height: 160px;
  overflow-y: auto;
}
@media (max-width: 720px) { .jfa-icon-picker { grid-template-columns: repeat(6, 1fr); } }
.jfa-icon-option {
  width: 32px; height: 32px;
  background: #fff;
  border: 1.5px solid transparent;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #475569;
  cursor: pointer;
  transition: all 0.12s;
}
.jfa-icon-option:hover { background: #EEF2FF; color: #4541FF; }
.jfa-icon-option.selected {
  background: #EEF2FF;
  color: #4541FF;
  border-color: #4541FF;
}

/* ============================================================
 * v1.9.0+ 포스터 빌더 UI
 * ============================================================ */
.jfa-poster-builder {
  padding: 18px;
  background: linear-gradient(180deg, #FAFBFD 0%, #fff 100%);
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  margin-bottom: 20px;
}
.jfa-poster-input-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (min-width: 720px) {
  .jfa-poster-input-row { grid-template-columns: 1fr 1fr; }
}
.jfa-poster-input { display: flex; flex-direction: column; gap: 6px; }
.jfa-poster-input-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.jfa-poster-preview-wrap {
  margin-top: 14px;
  padding: 14px;
  background: #fff;
  border: 1.5px dashed #C7D2FE;
  border-radius: 10px;
}
.jfa-poster-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #F8FAFC;
  border-radius: 8px;
  padding: 10px;
  min-height: 200px;
}
.jfa-poster-preview img {
  max-width: 100%;
  max-height: 320px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.jfa-poster-empty {
  margin-top: 14px;
  padding: 40px 20px;
  text-align: center;
  color: #94A3B8;
  background: #FAFBFD;
  border: 2px dashed #E2E8F0;
  border-radius: 10px;
}
.jfa-poster-empty i { font-size: 40px; opacity: 0.4; display: block; margin-bottom: 8px; }
.jfa-poster-empty p { margin: 0; font-size: 13px; }
