/* 안전체험관 키오스크 관리자 — Sneat(core.css · theme-default.css) 위에 얹는 커스텀 오버레이.
   룩은 Sneat 클래스가 담당. 여기는 한글 폰트 · 모달/토스트 · 드롭존 · 4개국어 입력 · 핫스팟 편집기 · 초안 바. */

body {
  font-family: "Public Sans", "Pretendard Variable", Pretendard, "Malgun Gothic",
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.adm-modal-open { overflow: hidden; }
#me-badge { text-transform: none; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: -.01em; }
.min-w-0 { min-width: 0; }
.sec-title { font-size: .78rem; font-weight: 700; color: #8592a3; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 .5rem; }
.card-title-sm { font-size: .95rem; font-weight: 600; margin: 0; }

/* ── 대시보드 ── */
.kpi-icon {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: .5rem; font-size: 1.4rem; flex: 0 0 auto;
}
.kpi-num { font-size: 1.55rem; font-weight: 700; line-height: 1.15; color: #566a7f; }
a.kpi-link { color: inherit; display: block; height: 100%; }
a.kpi-link:hover .card { box-shadow: 0 4px 14px rgba(105, 108, 255, .25); }

/* ── 상태 칩 ── */
.hchip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.hchip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.hc-ok { background: #e8fadf; color: #3f8f14; }
.hc-warn { background: #fff2d6; color: #b77900; }
.hc-err { background: #ffe0db; color: #e0290a; }
.hc-off { background: #ebeef0; color: #6d7a88; }
.hc-info { background: #d7f5fc; color: #0082a3; }

/* 저장 대기(수정됨) 버튼 */
.btn.btn-dirty { background: #ffab00; border-color: #ffab00; color: #fff; }

/* ── 모달 (Bootstrap .modal 과 충돌 방지용 자체 오버레이) ── */
.adm-modal {
  position: fixed; inset: 0; background: rgba(50, 71, 92, .5); z-index: 1090;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.adm-modal-box { width: 600px; max-width: 100%; }
.adm-modal-box.wide { width: 940px; }
pre.code {
  font-size: 12px; background: #f5f5f9; padding: 10px 12px; border-radius: 6px; margin: 0;
  white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto;
}

/* ── 토스트 ── */
.adm-toast {
  position: fixed; bottom: 24px; right: 24px; background: #566a7f; color: #fff; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); white-space: pre-line;
  font-size: 13px; z-index: 1100; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.adm-toast.show { opacity: 1; transform: none; }
.adm-toast.err { background: #ff3e1d; }

/* ── 이미지 드롭존 (admin-image-upload 표준) ── */
.adm-drop {
  border: 2px dashed #d9dee3; border-radius: .5rem; padding: 14px 12px; text-align: center;
  color: #697a8d; cursor: pointer; background: #fff; font-size: 13px;
  transition: border-color .15s, background .15s;
}
.adm-drop:hover, .adm-drop:focus-visible, .adm-drop.drag { border-color: #696cff; background: #f4f4ff; outline: none; }
.adm-drop i { font-size: 24px; color: #a1acb8; display: block; margin-bottom: 2px; transition: color .15s; }
.adm-drop:hover i, .adm-drop.drag i { color: #696cff; }
.adm-drop small { display: block; margin-top: 2px; }
.adm-drop.compact { display: flex; align-items: center; gap: 8px; padding: 8px 10px; text-align: left; font-size: 12px; }
.adm-drop.compact i { font-size: 22px; display: inline; margin: 0; }
.adm-drop.busy { pointer-events: none; opacity: .5; }

/* ── 4개국어 입력 — 칸 자체 폭에 맞춰 4열 → 2열 → 1열 (컨테이너 쿼리) ── */
.lf { margin-bottom: 14px; container-type: inline-size; }
.lf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; min-height: 22px; }
.lf-head .form-label { font-size: 13px; font-weight: 600; color: #566a7f; text-transform: none; letter-spacing: 0; }
.lf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lf-cell { position: relative; min-width: 0; }
.lf-tag {
  position: absolute; top: 6px; left: 7px; font-size: 10px; font-weight: 700; color: #a1acb8;
  pointer-events: none; letter-spacing: .03em;
}
.lf-cell .form-control { padding-left: 30px; font-size: 13px; }
.lf-cell textarea.form-control { padding-left: 10px; padding-top: 20px; resize: vertical; }
.lf-multi .lf-tag { top: 4px; left: 10px; }
.form-control.lf-missing { border-color: #ffab00; background: #fffaf0; }
@container (max-width: 700px) { .lf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 330px) { .lf-grid { grid-template-columns: minmax(0, 1fr); } }
.order-list .list-group-item.active-menu { background: #f4f4ff; font-weight: 600; }
.lf-badges .badge { font-size: 11px; text-transform: none; }

/* ── 이미지 칸 — 썸네일 + 드롭존, 자리가 좁으면 드롭존이 아래로 내려간다 ── */
.imgf { margin-bottom: 14px; }
.imgf .lbl { font-size: 13px; font-weight: 600; color: #566a7f; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.imgf-body { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.imgf-thumb {
  width: 140px; height: 96px; flex: 0 0 auto; border-radius: 6px; background: #eceef1; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: #a1acb8; font-size: 12px;
  border: 1px solid #e4e6e8;
}
.imgf-thumb.tall { width: 74px; height: 132px; }
.imgf-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgf-thumb.contain img { object-fit: contain; background: #fff; }
.imgf-body .adm-drop.compact { flex: 1 1 150px; min-width: 150px; }
.imgf.missing .imgf-thumb { border-color: #ff3e1d; border-style: dashed; }
.link-btn { background: none; border: 0; padding: 0 .2rem; font-size: 12px; font-weight: 500; line-height: 1.6; color: #4891da; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: #ff3e1d; }

/* Sneat 는 배지·라벨을 대문자로 바꾼다 — id(v1 · b1 · overview)가 바뀌어 보이지 않게 끈다 */
.badge, .form-label, .table th { text-transform: none; }
.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.photo-tile { position: relative; width: 96px; height: 68px; border-radius: 6px; overflow: hidden; background: #eceef1; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile button {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; line-height: 22px; padding: 0; cursor: pointer;
}

/* ── 항목 카드 (블록·카드·존·슬라이드) ── */
.item-card { border: 1px solid #e4e6e8; border-radius: .5rem; padding: 12px 14px 2px; margin-bottom: 12px; background: #fff; }
.item-card.sub { background: #fafbfc; }
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.item-head .title { font-weight: 600; color: #566a7f; font-size: 14px; }
.item-head .tools { margin-left: auto; display: flex; gap: 4px; }
.id-input { width: 160px; font-size: 12px; }
.btn-xs { padding: 2px 8px; font-size: 12px; line-height: 1.5; }
.menu-pills { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.menu-pills .nav-link { white-space: nowrap; }
.nav-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ffab00; margin-left: 5px; vertical-align: middle; }
.order-list .list-group-item { display: flex; align-items: center; gap: 8px; padding: .45rem .75rem; font-size: 13px; }

/* ── 초안 바 (하단 고정) ── */
.draft-bar-wrap { position: sticky; bottom: 12px; z-index: 6; }
.draft-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-radius: .5rem;
  background: #fff; border: 1px solid #d9dee3; box-shadow: 0 6px 24px rgba(67, 89, 113, .22); font-size: 13px;
}
.draft-bar.dirty { border-color: #ffab00; }
.draft-bar .state { font-weight: 600; color: #566a7f; }
.draft-bar .ms-auto { display: flex; gap: 6px; }

/* ── 핫스팟 편집기 ── */
.hs-stage { position: relative; user-select: none; background: #f5f5f9; border-radius: .5rem; overflow: hidden; line-height: 0; }
.hs-stage img { width: 100%; height: auto; display: block; }
.hs-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.hs-stage.drawing svg { cursor: crosshair; }
.hs-poly { fill: #8592a3; fill-opacity: .14; stroke: #8592a3; cursor: pointer; }
.hs-poly:hover { fill-opacity: .3; }
.hs-poly.sel { fill: #696cff; fill-opacity: .35; stroke: #696cff; }
.hs-line { fill: none; stroke: #696cff; stroke-dasharray: 6 4; }
.hs-vtx { fill: #fff; stroke: #696cff; cursor: grab; }
.hs-vtx.first { fill: #696cff; }
.hs-empty { padding: 60px 20px; text-align: center; color: #8592a3; line-height: 1.6; }
.hs-hint { font-size: 12px; color: #697a8d; }
.room-list .list-group-item { cursor: pointer; display: flex; align-items: center; gap: 8px; padding: .5rem .75rem; font-size: 13px; }
.room-list .list-group-item.active { background: #e7e7ff; color: #696cff; border-color: #e4e6e8; }
.room-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* ── 게시 ── */
.diff-list { max-height: 260px; overflow-y: auto; font-size: 13px; }
.diff-list td { vertical-align: top; }
.diff-before { color: #ff3e1d; text-decoration: line-through; }
.diff-after { color: #3f8f14; }
.thumb-row { display: flex; flex-wrap: wrap; gap: 6px; }
.thumb-row img { width: 64px; height: 46px; object-fit: cover; border-radius: 4px; background: #eceef1; }
.problem-list { font-size: 13px; margin: 0; padding-left: 1.1rem; }
.problem-list li { margin-bottom: 2px; }

/* ── 로그인 ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; background: #f5f5f9; }
.login-box { width: 400px; max-width: 100%; }

/* ── 반응형 ── */
@supports not (container-type: inline-size) {   /* 옛 브라우저 — 화면 폭 기준 */
  @media (max-width: 1399.98px) { .lf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 575.98px) { .lf-grid { grid-template-columns: minmax(0, 1fr); } }
}
@media (max-width: 575.98px) {
  .adm-modal { padding: 12px 8px; }
  .adm-toast { left: 16px; right: 16px; bottom: 16px; }
  .kpi-num { font-size: 1.3rem; }
  .container-p-y { padding-top: 1rem !important; }
  .id-input { width: 120px; }
}

/* ── schema 2 (2026-10-21): 위치 보기 연결 · 기기 '지금 여기' 찍기 ── */
.link-fields { margin-top: 6px; margin-bottom: 10px; }
.link-fields .form-select { min-width: 150px; }
.here-pick { position: relative; display: inline-block; max-width: 100%; border: 1px solid #d9dee3; border-radius: 6px; overflow: hidden; }
.here-pick img { display: block; max-width: 100%; max-height: 420px; cursor: crosshair; }
.here-dot { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #ff3e1d; border: 2px solid #fff;
  transform: translate(-50%, -50%); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35); pointer-events: none; }
.here-dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255, 62, 29, .5); transform: translate(-50%, -50%); }
