body {
  background: #f6f8ff;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1c2750;
}

.wrap {
  max-width: 1120px;
  margin: 48px auto 84px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.page-header {
  padding: 40px 46px;
  background: var(--gradient-brand);
  color: #fff;
}

.page-header h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.page-header p {
  margin-top: 12px;
  opacity: 0.85;
  font-size: 15px;
}

.content-body {
  padding: 40px 42px 54px;
  background: linear-gradient(180deg, rgba(247, 249, 255, 0.85) 0%, rgba(247, 249, 255, 1) 55%);
}

.tbl_wrap {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.tbl_wrap table {
  width: 100%;
  border-collapse: collapse;
}

.tbl_wrap td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  background: rgba(255, 255, 255, 0.98);
  font-size: 14px;
  color: var(--text);
}

.tbl_wrap tr:last-child td {
  border-bottom: none;
}

.col_303030 {
  width: 200px;
  background: rgba(99, 102, 241, 0.06);
  font-weight: 600;
  color: var(--brand-dark);
}

.form-control {
  width: 260px;
  padding: 12px 16px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius-pill);
  transition: var(--transition);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.94);
}

.form-control[type="date"],
.form-control[type="time"] {
  width: auto !important;
  min-width: 140px;
  font-size: 14px !important;
  padding: 8px 10px !important;
  line-height: 1.5 !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.form-control[type="time"] {
  min-width: 110px !important;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.checkbox,
.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  font-size: 14px;
  color: #1c2750;
}

.section-divider {
  background: rgba(99, 102, 241, 0.08);
  border-top: 1px solid rgba(99, 102, 241, 0.12);
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
  padding: 22px 28px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: -0.01em;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.18);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.section-description {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}

.creative-manager {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.creative-pool,
.creative-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
  min-height: 36px;
  border: 1px dashed #c0caea;
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(247, 249, 255, 0.74);
}

.creative-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.22);
  color: var(--brand-dark);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s ease;
}

.creative-chip.selected {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.3);
}

.creative-chip .action {
  font-weight: 700;
  color: #2563eb;
}

.button-bar {
  margin-top: 26px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  transition: 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #1c2750;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm, 0 10px 20px rgba(15, 23, 42, 0.08));
}

.btn-black {
  background: #1f2937;
  color: #fff;
}

.btn-black:hover {
  background: #111827;
}

.btn-primary {
  background: #ffffff !important;
  color: #3498db !important;
  border: 1px solid #3498db !important;
  font-weight: 600;
}

.btn-primary:hover {
  background: #3498db !important;
  color: white !important;
}

.btn-emerald {
  background: #ffffff !important;
  color: #3498db !important;
  border: 1px solid #3498db !important;
  font-weight: 600;
}

.btn-emerald:hover {
  background: #3498db !important;
  color: white !important;
}

.empty-placeholder {
  border: 1px dashed rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  background: rgba(247, 249, 255, 0.75);
}

.help-text {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

.cpa-action-item,
.cpi-action-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius-md);
  background: rgba(247, 249, 255, 0.5);
}

.cpa-action-item > div,
.cpi-action-item > div {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cpa-action-item input[type="text"],
.cpi-action-item input[type="text"] {
  flex: 1;
  min-width: 200px;
}

.cpa-action-item .form-control,
.cpi-action-item .form-control {
  width: auto;
  min-width: 160px;
}

/* CPC/CPM rowspan 문제 해결 */
.tbl_wrap tr[style*="display: none"] .col_303030[rowspan] {
  display: none !important;
}

.cpa-action-item .remove-action-btn {
  padding: 6px 12px;
  font-size: 12px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s ease;
}

.cpa-action-item .remove-action-btn:hover {
  background: #dc2626;
}

.chip-field {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.chip-label {
  width: 90px;
  font-weight: 600;
  color: #1c2750;
  line-height: 32px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c0caea;
  border-radius: 999px;
  background: #fff;
  padding: 6px 14px;
  gap: 8px;
  cursor: pointer;
  transition: 0.2s ease;
  font-size: 13px;
  font-weight: 600;
  color: #41506f;
}

.chip-toggle input {
  display: none;
}

.chip-toggle span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.chip-toggle input:checked + span {
  color: #1c2750;
}

.chip-toggle input[type="checkbox"]:checked + span,
.chip-toggle input[type="radio"]:checked + span {
  position: relative;
}

.chip-toggle input[type="checkbox"]:checked + span::before,
.chip-toggle input[type="radio"]:checked + span::before {
  content: "";
  position: absolute;
  inset: -6px -12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.38);
  z-index: -1;
}

.chip-toggle:hover {
  border-color: #94a3d0;
}

@media (max-width: 960px) {
  .wrap {
    margin: 24px;
  }
  .content-body {
    padding: 28px 24px 36px;
  }
  .form-control {
    width: 100%;
  }
  .tbl_wrap table,
  .tbl_wrap tbody,
  .tbl_wrap tr,
  .tbl_wrap td {
    display: block;
    width: 100%;
  }
  .tbl_wrap td {
    border-bottom: none;
    padding: 12px 0;
  }
  .col_303030 {
    background: transparent;
    font-size: 13px;
    margin-bottom: 6px;
  }
  .button-bar {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
  .creative-manager {
    flex-direction: column;
  }
}

/* 캠페인 등록 페이지 소재 칩 이미지 툴팁 스타일 */
.creative-chip-tooltip {
  position: absolute;
  z-index: 10000;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 8px;
  pointer-events: none;
  max-width: 400px;
  max-height: 400px;
}.creative-chip-tooltip img {
  display: block;
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  border-radius: 4px;
}.creative-chip-tooltip .tooltip-arrow {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #fff;
}

.creative-chip-tooltip .tooltip-arrow::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #ddd;
}