/* QR 모달 정돈 · 왼쪽 트리 그룹 추가 */

/* =====================================================================
   장비 QR 모달 (js/qrModal.js)
   위 = QR + 설명·결제 주소 / 가운데 = 작업 버튼 한 줄 / 아래 = 알림
   ===================================================================== */
.qrm { display: flex; flex-direction: column; gap: 16px; }
.qrm-top { display: flex; gap: 18px; align-items: center; }
.qrm-img {
  width: 176px; height: 176px; flex-shrink: 0; padding: 8px;
  background: #FFFFFF; border: 1px solid var(--border); border-radius: 12px;
}
.qrm-img svg { width: 100%; height: 100%; display: block; }
.qrm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.qrm-lead { font-size: 14px; font-weight: 800; color: var(--text); }
.qrm-desc { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--text-muted); }
.qrm-url {
  display: flex; flex-direction: column; gap: 3px; padding: 9px 11px;
  background: var(--accent-softer); border: 1px solid var(--border-subtle); border-radius: 10px;
}
.qrm-url-k { font-size: 11px; font-weight: 800; color: var(--text-faint); letter-spacing: .02em; }
.qrm-url-v {
  font-size: 12px; line-height: 1.45; color: var(--text-body); word-break: break-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 작업 버튼: 같은 크기의 타일을 한 줄로 (재발급이 있으면 5칸, 없으면 4칸) */
.qrm-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qrm-actions.has-reissue { grid-template-columns: repeat(5, 1fr); }
.qrm-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 68px; padding: 10px 6px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-body);
  font: inherit; font-size: 12px; font-weight: 700; line-height: 1.25; text-align: center;
  text-decoration: none; cursor: pointer; transition: background .12s, border-color .12s, color .12s;
}
.qrm-act svg { color: var(--accent); flex-shrink: 0; }
.qrm-act:hover { border-color: var(--accent); background: var(--accent-softer); color: var(--accent); }
.qrm-act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.qrm-act:disabled { opacity: .6; cursor: progress; }
.qrm-act.done { border-color: var(--ok-border-strong); background: var(--ok-bg); color: var(--ok-text-strong); }
.qrm-act.done svg { color: var(--ok-text); }
.qrm-act.danger { border-color: var(--err-border); color: var(--err-text); }
.qrm-act.danger svg { color: var(--err-dot); }
.qrm-act.danger:hover { background: var(--err-bg); border-color: var(--err-dot); color: var(--err-text-strong); }

/* 알림 줄 */
.qrm-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qrm-notes li {
  position: relative; padding: 8px 10px 8px 28px; border-radius: 9px;
  font-size: 12px; line-height: 1.55; color: var(--text-muted); background: var(--accent-softer);
}
.qrm-notes li::before {
  content: ''; position: absolute; left: 11px; top: 13px; width: 7px; height: 7px; border-radius: 50%;
}
.qrm-notes li.info::before { background: var(--info-dot); }
.qrm-notes li.warn { background: var(--err-bg); color: var(--err-text); }
.qrm-notes li.warn::before { background: var(--err-dot); }
.qrm-notes a { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* 모바일: 아래에서 올라오는 시트 · QR 가운데 · 버튼 3칸 격자 */
@media (max-width: 640px) {
  .qr-modal:not(.pay-detail) {
    top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%;
    max-height: 92dvh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom);
  }
  .qrm-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .qrm-img { width: 168px; height: 168px; align-self: center; }
  .qrm-lead, .qrm-desc { text-align: center; }
  .qrm-actions, .qrm-actions.has-reissue { grid-template-columns: repeat(3, 1fr); }
  .qrm-act { min-height: 64px; }
}


/* =====================================================================
   왼쪽 장비 트리 · 맨 위 "그룹 추가" (dashboard.js)
   ===================================================================== */
.tree-add-group {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px 0 9px;
  border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  background: var(--accent-soft); color: var(--accent);
  font: inherit; font-size: 12px; font-weight: 800; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.tree-add-group:hover { background: var(--accent); color: #FFFFFF; }
.tree-add-group:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tree-add-group[hidden] { display: none; }
/* 모바일 서랍: 손가락으로 누르기 쉽게 키운다 */
@media (max-width: 900px) {
  .tree-add-group { height: 36px; padding: 0 14px 0 12px; font-size: 13px; }
}
