/* ── Detail Screens Pack · P2.6 · 2026-04-22 ────────────────────
   6개 상세 화면 공용 스타일 (dt = detail namespace).
   토큰: css/tokens.css · 컴포넌트: css/components.css */

/* ── 진입 애니메이션 (§5.9 right-to-left 280ms) ─────────────── */
@keyframes dtSlideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.dt-shown {
  animation: dtSlideIn 280ms cubic-bezier(.4, 0, .2, 1) both;
}

/* ── 오버레이 레이아웃 ─────────────────────────────────────── */
.dt-overlay {
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ── 헤더 ────────────────────────────────────────────────────── */
.dt-hdr {
  padding: max(52px, calc(env(safe-area-inset-top) + 14px)) 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dt-back,
.dt-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: none;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  transition: opacity .12s;
}

.dt-back:active,
.dt-close:active {
  opacity: .6;
}

.dt-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

/* ── 바디 스크롤 ──────────────────────────────────────────────── */
.dt-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px max(24px, calc(env(safe-area-inset-bottom) + 16px));
}

.dt-body::-webkit-scrollbar {
  display: none;
}

/* ── 리스트 컨테이너 & 아이템 ─────────────────────────────────── */
.dt-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.dt-list-it {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  width: 100%;
  border-left: none;
  border-right: none;
  border-top: none;
  transition: background .12s;
}

.dt-list-it:last-child {
  border-bottom: none;
}

.dt-list-it:active {
  background: var(--surface-2);
}

.dt-list-it__main {
  flex: 1;
  min-width: 0;
}

.dt-list-it__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dt-list-it__sub {
  font-size: 12px;
  color: var(--text-subtle);
  margin: 0;
  line-height: 1.4;
}

/* ── 빈 상태 §5.7 ───────────────────────────────────────────── */
.dt-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 13px;
  line-height: 1.6;
}

.dt-loading {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 13px;
}

/* ── 에러 배너 §5.11 danger ───────────────────────────────────── */
.dt-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: var(--r-md);
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 14px;
}

/* ── 오프라인 배지 ─────────────────────────────────────────────── */
.dt-offline-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--warn);
  color: #fff;
  font-weight: 700;
  display: none;
}

.dt-offline-badge--on {
  display: inline-block;
}

/* ── 폼 필드 §5.13 ──────────────────────────────────────────── */
.dt-field-row {
  margin-bottom: 12px;
}

.dt-field-lbl {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dt-field {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}

.dt-field:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(241, 128, 145, .15);
}

textarea.dt-field {
  resize: vertical;
}

select.dt-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238B95A1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.dt-field[readonly] {
  background: var(--surface-2);
  color: var(--text-muted);
}

/* ── 예약 상태 버튼 ─────────────────────────────────────────── */
.dt-status-row {
  display: flex;
  gap: 6px;
}

.dt-status-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.dt-status-btn--confirmed {
  border-color: var(--brand);
  background: var(--brand-bg);
  color: var(--brand-strong);
}

.dt-status-btn--completed {
  border-color: var(--ok);
  background: rgba(22, 181, 94, .08);
  color: #0d8f49;
}

.dt-status-btn--cancelled {
  border-color: var(--danger);
  background: rgba(239, 68, 68, .08);
  color: var(--danger);
}

/* ── 하단 액션 ───────────────────────────────────────────────── */
.dt-footer {
  padding: 12px 16px max(16px, calc(env(safe-area-inset-bottom) + 12px));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── 충돌 경고 ───────────────────────────────────────────────── */
.dt-conflict {
  display: none;
  font-size: 12px;
  color: var(--danger);
  margin-bottom: 10px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, .06);
  border-radius: var(--r-sm);
  border: 1px solid rgba(239, 68, 68, .15);
}

/* ── NPS 히어로 §5.1 축소형 ──────────────────────────────────── */
.dt-nps-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.dt-nps-hero__score {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1;
}

.dt-nps-hero__label {
  font-size: 11px;
  opacity: .85;
  margin-bottom: 4px;
}

.dt-nps-hero__pills {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.dt-nps-pill {
  flex: 1;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

/* ── 재고 수량 스텝퍼 ─────────────────────────────────────────── */
.dt-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dt-stepper__btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  display: grid;
  place-items: center;
  font-family: inherit;
  transition: background .12s;
}

.dt-stepper__btn:active {
  background: var(--surface-2);
}

.dt-stepper__val {
  flex: 1;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.dt-stepper__val--low {
  color: var(--danger);
}

/* ── 검색 인풋 래퍼 ──────────────────────────────────────────── */
.dt-search-wrap {
  padding: 0 0 10px;
}
