/* 운영 CMS — 투어 현황 */

/* 평면도 2장 나란히 */
.ts-floors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ts-floor .card__head { margin-bottom: 6px; }
.ts-stage { position: relative; user-select: none; }
.ts-stage img { display: block; width: 100%; height: auto; opacity: .9; }
body[data-theme="dark"] .ts-stage img { filter: invert(1) brightness(.8); opacity: .7; }

/* 혼잡도 원 */
.ts-heat {
  position: absolute; transform: translate(-50%, -50%); border-radius: 50%;
  border: 0; padding: 0; cursor: pointer; filter: blur(2px);
}
.ts-heat--low { background: radial-gradient(closest-side, rgba(43, 182, 115, .45), rgba(43, 182, 115, 0)); }
.ts-heat--mid { background: radial-gradient(closest-side, rgba(246, 189, 43, .55), rgba(246, 189, 43, 0)); }
.ts-heat--high { background: radial-gradient(closest-side, rgba(239, 74, 90, .6), rgba(239, 74, 90, 0)); animation: ts-throb 2.4s ease-in-out infinite; }
@keyframes ts-throb { 50% { transform: translate(-50%, -50%) scale(1.08); } }

/* 존 라벨 */
.ts-label {
  position: absolute; transform: translate(-50%, -135%);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 3px 8px 3px 10px; border-radius: 999px; border: 2px solid transparent;
  background: var(--c-surface); color: var(--c-text); box-shadow: 0 2px 8px rgba(20, 20, 40, .14);
  font: inherit; font-size: var(--fs-xs); cursor: pointer; z-index: 3;
}
.ts-label--area { padding: 2px 8px; background: var(--f-card-soft, #f3f3f7); }
.ts-label--area strong { font-weight: 400; }
.ts-label:hover { border-color: var(--c-line-strong, #ccc); }
.ts-label.is-active { border-color: var(--f-primary, var(--c-primary)); box-shadow: 0 4px 14px rgba(140, 124, 240, .35); }
/* 존을 고르면 나머지 존은 흐리게 */
.ts-stage.has-zone .ts-heat:not(.is-active), .ts-stage.has-zone .ts-label:not(.is-active) { opacity: .35; }
.ts-listcard.is-flash { animation: ts-flash 1s ease-out; }
@keyframes ts-flash { from { box-shadow: 0 0 0 4px var(--f-primary, #8c7cf0); } to { box-shadow: 0 0 0 0 transparent; } }
.ts-label strong { font-weight: 500; }
.ts-label span { color: var(--c-sub); font-variant-numeric: tabular-nums; }
.ts-mark {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 11px; color: var(--c-sub); background: var(--f-card-soft, #f2f2f5);
  padding: 1px 7px; border-radius: 999px; pointer-events: none; white-space: nowrap;
}

/* 혼잡 단계 배지 */
.ts-lv { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 999px; line-height: 18px; }
.ts-lv--low { background: var(--c-ok-soft); color: var(--c-ok); }
.ts-lv--mid { background: var(--c-warn-soft); color: var(--c-warn); }
.ts-lv--high { background: var(--c-err-soft); color: var(--c-err); }

/* 관람객 점 */
.ts-dot {
  position: absolute; transform: translate(-50%, -50%);
  width: 8px; height: 8px; padding: 0; border-radius: 50%;
  border: 1.5px solid #fff; cursor: pointer; transition: transform .15s, opacity .15s;
}
.ts-dot:hover { transform: translate(-50%, -50%) scale(1.6); z-index: 2; }
.ts-dot--static { position: static; transform: none; display: inline-block; vertical-align: middle; margin-right: 6px; cursor: default; }
.ts-dot--static:hover { transform: none; }
.ts-dot--solo { background: #8c7cf0; }
.ts-dot--group { background: #f08a3c; }
.ts-dot--vip { background: #e3b11f; }

/* 선택한 관람객: 경로 + 핀 */
.ts-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ts-path polyline { fill: none; stroke: var(--f-primary, #8c7cf0); stroke-width: 5; stroke-dasharray: 10 8; stroke-linecap: round; stroke-linejoin: round; animation: ts-dash 1.2s linear infinite; }
@keyframes ts-dash { to { stroke-dashoffset: -18; } }
.ts-pin { position: absolute; transform: translate(-50%, -50%); width: 0; height: 0; z-index: 5; pointer-events: none; }
.ts-pin__dot {
  position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--f-primary, #8c7cf0); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.ts-pin__pulse {
  position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--f-primary, #8c7cf0); opacity: .35; animation: ts-pulse 1.6s ease-out infinite;
}
@keyframes ts-pulse { from { transform: scale(.3); opacity: .5; } to { transform: scale(1.4); opacity: 0; } }

/* 범례 */
.ts-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 0 6px; font-size: var(--fs-xs); color: var(--c-sub); }
.ts-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ts-legend .ts-dot--static { margin-right: 0; }
.ts-legend .card__note { margin-left: auto; }
.ts-legend__sep { width: 1px; height: 14px; background: var(--c-line); }
.ts-sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.ts-sw--low { background: rgba(43, 182, 115, .55); }
.ts-sw--mid { background: rgba(246, 189, 43, .7); }
.ts-sw--high { background: rgba(239, 74, 90, .7); }

/* 진행 중인 투어 */
.ts-tours { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ts-tour {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 10px 12px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--f-card-soft, #f5f6f8); color: var(--c-text);
}
.ts-tour:hover { filter: brightness(.98); }
.ts-tour__icon { position: static; transform: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 0; flex: none; }
.ts-tour__icon .lucide { width: 16px; height: 16px; }
.ts-tour__body { flex: 1; display: flex; flex-direction: column; }
.ts-tour__body strong { font-weight: 500; }
.ts-tour__body span { font-size: var(--fs-xs); color: var(--c-sub); }

/* 목록 + 상세 */
.ts-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.ts-listhead { flex-wrap: wrap; gap: 10px; }
.ts-listhead .card__title .card__note { margin-left: 4px; }
.ts-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ts-select, .ts-search {
  height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--c-line);
  background: var(--c-surface); color: var(--c-text); font-size: var(--fs-sm);
}
.ts-search { width: 150px; }
.ts-tablewrap { max-height: 420px; overflow-y: auto; }
.ts-table thead th, .app--finly .ts-table thead th { position: sticky; top: 0; background: var(--c-surface); z-index: 1; }
.ts-table tbody tr { cursor: pointer; }
.ts-table tbody tr.is-selected { background: var(--c-primary-soft); }
.ts-prog { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.ts-prog .bar { flex: 1; }
.ts-prog span { font-size: var(--fs-xs); color: var(--c-sub); }

.ts-detail { position: sticky; top: 0; }
.ts-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 10px; text-align: center; color: var(--c-sub); font-size: var(--fs-sm); }
.ts-empty .lucide { width: 28px; height: 28px; color: var(--c-muted); }
.ts-detail__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ts-detail__head > div { flex: 1; display: flex; flex-direction: column; }
.ts-detail__head strong { font-size: 18px; font-weight: 500; }
.ts-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.ts-avatar .lucide { width: 20px; height: 20px; }
.ts-now {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px;
  border-radius: 12px; background: var(--c-primary-soft); font-size: var(--fs-sm);
}
.ts-now .lucide { width: 16px; height: 16px; color: var(--f-primary, var(--c-primary)); }
.ts-now span { flex: 1; }
.ts-dl { font-size: var(--fs-sm); }
.ts-sub { margin: 14px 0 6px; font-size: var(--fs-xs); color: var(--c-sub); }
.ts-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ts-journey { list-style: none; margin: 0; padding: 0; }
.ts-journey li { position: relative; display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: var(--fs-sm); }
.ts-journey li::before { content: ""; position: absolute; left: 5px; top: -50%; height: 100%; width: 2px; background: var(--c-line); }
.ts-journey li:first-child::before { display: none; }
.ts-journey li span:nth-child(2) { flex: 1; }
.ts-journey time { font-size: var(--fs-xs); color: var(--c-sub); font-variant-numeric: tabular-nums; }
.ts-journey__dot { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-line-strong, #ccc); flex: none; }
.ts-journey li.is-done .ts-journey__dot { background: var(--f-primary, var(--c-primary)); border-color: var(--f-primary, var(--c-primary)); }
.ts-journey li.is-done::before, .ts-journey li.is-now::before { background: var(--f-primary, var(--c-primary)); }
.ts-journey li.is-now .ts-journey__dot { background: #fff; border-color: var(--f-primary, var(--c-primary)); box-shadow: 0 0 0 4px var(--c-primary-soft); }
.ts-journey li.is-now span:nth-child(2) { font-weight: 500; }
.ts-journey li.is-todo { color: var(--c-muted); }

@media (max-width: 1280px) {
  .ts-bottom { grid-template-columns: 1fr; }
  .ts-detail { position: static; }
}
@media (max-width: 1000px) {
  .ts-floors, .ts-tours { grid-template-columns: 1fr; }
}

/* 현장 현황용 미니맵 */
.fm-card .card__head { margin-bottom: 10px; }
.fm-legend { display: flex; align-items: center; gap: 12px; font-size: var(--fs-xs); color: var(--c-sub); }
.fm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fm-legend .ts-sw { width: 10px; height: 10px; }
.fm-alert { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; padding: 4px 10px; border-radius: 999px; background: var(--c-err-soft); color: var(--c-err); font-size: var(--fs-xs); }
.fm-alert .lucide { width: 13px; height: 13px; }
.fm-floors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fm-floor { border-radius: 14px; background: var(--m-card-2, #fff); border: 1px solid var(--c-line); padding: 8px 10px 6px; }
.fm-floor__head { display: flex; justify-content: space-between; font-size: var(--fs-sm); margin-bottom: 2px; }
.fm-floor__head span { color: var(--c-sub); font-size: var(--fs-xs); }
.fm-stage .ts-heat { height: auto; }
.fm-label { font-size: 10px; padding: 1px 6px 1px 7px; gap: 4px; text-decoration: none; }
.fm-label:hover { text-decoration: none; }
.fm-label .ts-lv { font-size: 9px; line-height: 15px; padding: 0 4px; }
@media (max-width: 1000px) { .fm-floors { grid-template-columns: 1fr; } }
