/* ═══ 타겟관리 (2026-08-24) — DB관리 > 타겟관리 (.tgm-*)
 * ⚠페이지 본문 = 표준 페이지 문법(광고캠페인관리와 동일 톤: #111827 타이틀·#2563eb 파랑·#e5e7eb 보더).
 *   A-4 액센트형(차콜 #3e6187)은 «모달 내부»(자산·세그먼트·가이드) 전용 — 8/24 사용자 확정. */

/* ── 탭 (페이지 세그먼트 pill — 광고캠페인 자사/광고대행 토글과 동일 문법) ── */
.tgm-tabs { display: inline-flex; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px; padding: 3px; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tgm-tab { padding: 6px 16px; border: none; border-radius: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; background: transparent; color: #64748b; font-family: inherit; }
.tgm-tab:hover { color: #334155; }
.tgm-tab.on { background: #2563eb; color: #fff; font-weight: 700; }
.tgm-tab .tgm-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 4px; background: rgba(255,255,255,.2); }
.tgm-tab:not(.on) .tgm-tag { background: #e2e8f0; color: #64748b; }
.tgm-panel { display: none; }
.tgm-panel.on { display: block; }

/* ── 섹션 카드 (표준 흰 카드) ── */
.tgm-sec { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.tgm-sec-hd { display: flex; align-items: center; gap: 8px; padding: 11px 15px; border-bottom: 1px solid #f1f5f9; font-size: 13px; font-weight: 600; color: #111827; flex-wrap: wrap; }
.tgm-sec-hd .m { font-weight: 400; font-size: 11px; color: #9ca3af; }
.tgm-sec-hd .r { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tgm-sec-bd { padding: 14px 15px; }
.tgm-note { font-size: 11.5px; color: #9ca3af; line-height: 1.65; }

/* ── 테이블 (표준 목록 문법) ── */
.tgm-table { width: 100%; border-collapse: collapse; }
.tgm-table th { text-align: left; font-size: 11px; font-weight: 600; color: #6b7280; background: #f9fafb; padding: 8px 12px; border-bottom: 1px solid #e5e7eb; white-space: nowrap; }
.tgm-table td { font-size: 12.5px; padding: 9px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; color: #111827; }
.tgm-table tr:last-child td { border-bottom: 0; }
.tgm-table tr:hover td { background: #f9fafb; }
.tgm-empty { padding: 30px 16px; text-align: center; color: #9ca3af; font-size: 12.5px; line-height: 1.7; }

/* ── 칩·배지 ── */
.tgm-chip { display: inline-block; font-size: 10.5px; font-weight: 600; border-radius: 10px; padding: 2px 8px; white-space: nowrap; }
.tgm-chip.ok { background: #dcfce7; color: #166534; }
.tgm-chip.off { background: #f1f5f9; color: #94a3b8; }
.tgm-chip.warn { background: #fef3c7; color: #92400e; }
.tgm-chip.blocked { background: #fee2e2; color: #b91c1c; }
.tgm-chip.db { background: #dbeafe; color: #1d4ed8; }
.tgm-chip.order { background: #ede9fe; color: #6d28d9; }
.tgm-pf { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; border-radius: 8px; padding: 2px 8px; }
.tgm-pf.tiktok { background: #111827; color: #fff; }
.tgm-pf.meta { background: #dbeafe; color: #1d4ed8; }
.tgm-pf.google { background: #fee2e2; color: #dc2626; }

/* ── 버튼 (표준: 파랑 primary·회색 보더) ── */
.tgm-btn { border: 1px solid #d1d5db; background: #fff; color: #374151; font-size: 12px; font-weight: 600; border-radius: 8px; padding: 7px 14px; cursor: pointer; font-family: inherit; white-space: nowrap; }
.tgm-btn:hover { background: #f9fafb; }
.tgm-btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 700; }
.tgm-btn.primary:hover { background: #1d4ed8; }
.tgm-btn.sm { padding: 4px 10px; font-size: 11px; border-radius: 6px; }
.tgm-btn.danger { color: #dc2626; border-color: #fecaca; }

/* ── 자산 카드 ── */
.tgm-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.tgm-asset { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; background: #fff; }
.tgm-asset .hd { display: flex; align-items: center; gap: 10px; padding: 10px 13px; background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
.tgm-asset .nm { font-size: 13px; font-weight: 700; color: #111827; }
.tgm-asset .sub { font-size: 10.5px; color: #9ca3af; margin-top: 1px; word-break: break-all; }
.tgm-asset .bd { padding: 9px 13px; }
.tgm-asset .row { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 3px 0; color: #6b7280; }
.tgm-asset .row b { color: #111827; font-weight: 600; text-align: right; }
.tgm-asset .ft { padding: 8px 13px; border-top: 1px solid #f3f4f6; display: flex; gap: 6px; }
.tgm-logo { width: 28px; height: 28px; border-radius: 8px; color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tgm-logo.tiktok { background: #111827; }
.tgm-logo.meta { background: #1877f2; }
.tgm-logo.google { background: #ea4335; }

/* ── 연동 매트릭스 select ── */
.tgm-link-sel { border: 1px solid #d1d5db; border-radius: 7px; padding: 5px 9px; font-size: 12px; font-family: inherit; background: #fff; color: #111827; max-width: 160px; }
.tgm-link-sel:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ── 수신 준비 게이트 ── */
.tgm-gate { padding: 12px 14px; border-radius: 10px; border: 1px solid #fecaca; background: #fef2f2; }
.tgm-gate.ready { border-color: #bbf7d0; background: #f0fdf4; }
.tgm-gate .tt { font-size: 12.5px; font-weight: 600; color: #991b1b; line-height: 1.6; }
.tgm-gate.ready .tt { color: #166534; }
.tgm-gate .row2 { margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }

/* ── 이벤트 카드 (피드백 탭) ── */
.tgm-ev { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 10px; align-items: flex-start; }
.tgm-ev.on { border-color: #bfdbfe; background: #fbfdff; }
.tgm-ev .ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; background: #f3f4f6; }
.tgm-ev .ic.conv { background: #dcfce7; }
.tgm-ev .ic.block { background: #fee2e2; }
.tgm-ev .info { flex: 1; min-width: 0; }
.tgm-ev .t { font-size: 13px; font-weight: 700; color: #111827; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tgm-ev .d { font-size: 11.5px; color: #6b7280; margin-top: 3px; line-height: 1.6; }

/* ═══ 모달 내부 (A-4 액센트형 — 차콜 #3e6187, 모달 전용 컨셉) ═══ */
.tgm-fld { margin-bottom: 11px; }
.tgm-fld label { display: block; font-size: 11.5px; font-weight: 700; color: #475569; margin-bottom: 5px; }
.tgm-fld input[type=text], .tgm-fld select { width: 100%; border: 1.5px solid #c4d3e2; border-radius: 9px; padding: 8px 11px; font-size: 13px; font-family: inherit; background: #fcfdfe; color: #0f172a; box-sizing: border-box; }
.tgm-fld input:focus, .tgm-fld select:focus { outline: none; border-color: #3e6187; box-shadow: 0 0 0 3px #3e618722; }
.tgm-hint { font-size: 11px; color: #94a3b8; margin-top: 4px; line-height: 1.55; }
.tgm-hint.warn { color: #b45309; }
.tgm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.tgm-kind { display: flex; gap: 8px; }
.tgm-kind-btn { flex: 1; border: 1.5px solid #dbe6f0; border-radius: 11px; background: #fff; padding: 9px 12px; text-align: left; cursor: pointer; font-family: inherit; }
.tgm-kind-btn.on { border-color: #3e6187; background: #f3f7fb; box-shadow: 0 0 0 1px #3e6187; }
.tgm-kind-btn .kn { font-size: 12.5px; font-weight: 800; color: #0f172a; }
.tgm-kind-btn .kd { font-size: 10.5px; color: #64748b; margin-top: 2px; }
.tgm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tgm-st-chip { font-size: 12px; font-weight: 600; color: #475569; background: #fff; border: 1.5px solid #dbe6f0; border-radius: 16px; padding: 5px 12px; cursor: pointer; user-select: none; }
.tgm-st-chip.on { background: #3e6187; border-color: #3e6187; color: #fff; }
.tgm-inline-num { width: 52px; border: 1.5px solid #c4d3e2; border-radius: 7px; padding: 4px 6px; font-size: 12px; text-align: right; font-family: inherit; }
.tgm-opt-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #334155; padding: 5px 0; flex-wrap: wrap; }
.tgm-opt-row label { font-weight: 600; cursor: pointer; }
.tgm-opt-row .s { font-size: 11px; color: #94a3b8; }

/* 발사 이벤트 — 세그먼트 행 (2026-08-24: 표 폐기 — 스위치 세로선을 위 두 행과 통일) */
.tgm-icon-btn { border: 1px solid #d1d5db; background: #fff; border-radius: 7px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #6b7280; font-size: 13px; padding: 0; margin-left: 4px; }
.tgm-icon-btn:hover { background: #f9fafb; color: #374151; }
.tgm-seg-rows { margin-top: 8px; border-top: 1px solid #f1f5f9; }
.tgm-seg-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid #f1f5f9; }
.tgm-seg-row:last-child { border-bottom: none; padding-bottom: 2px; }
.tgm-seg-row .nm { font-size: 12.5px; font-weight: 700; color: #111827; }

@media (max-width: 760px) {
  .tgm-assets { grid-template-columns: minmax(0, 1fr); }
  .tgm-grid2 { grid-template-columns: minmax(0, 1fr); }
  .tgm-sec-bd { padding: 11px 12px; }
  .tgm-ev { padding: 10px 11px; gap: 9px; }
  .tgm-ev .ic { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
  .tgm-ev .d { font-size: 11px; }
  .tgm-seg-row { flex-wrap: wrap; row-gap: 4px; }
  .tgm-gate .row2 { flex-wrap: wrap; gap: 8px; }
  /* 표(발사 로그·맞춤타겟)는 통째 가로 스크롤 — 섹션이 아니라 표 래퍼가 스크롤 주체 */
  .tgm-sec { overflow-x: visible; }
  .tgm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tgm-table th, .tgm-table td { white-space: nowrap; }
}
