/* apt 담당 CSS — 클래스 접두어 .apt- 만. 토큰은 base.css :root(var(--…))만. 관리자 화면 틀이 자동으로 불러온다.
   기사·회원·리뷰·1:1 문의 관리 화면. */

/* 요약 지표 */
.apt-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 1rem; }
@media (max-width: 1100px) { .apt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .apt-stats .stat { padding: .75rem .85rem; } .apt-stats .stat .v { font-size: 1.5rem; } }
.apt-meta { font-size: .8125rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: .3rem; }

/* 조회 조건 */
.apt-filter { padding: 1rem 1.1rem; margin-bottom: 1rem; display: flex; flex-direction: column; gap: .85rem; }
.apt-filter-row { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.apt-filter .field { gap: .3rem; }
.apt-filter .field > label, .apt-filter .field .label { font-size: .875rem; font-weight: 700; color: var(--ink-2); }
.apt-filter .input, .apt-filter .select { min-height: 2.75rem; }
.apt-f-grow { flex: 1 1 14rem; }
.apt-f-date { flex: 0 1 10.5rem; }
.apt-f-sel { flex: 0 1 11rem; }
.apt-f-actions { display: flex; gap: .5rem; margin-left: auto; }
.apt-f-actions .btn { min-height: 2.75rem; }
.apt-chips .chip { min-height: 2.5rem; padding: 0 .9rem; font-size: .9375rem; }
.apt-quick { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; font-size: .875rem; }
.apt-quick a { padding: .2rem .6rem; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--ink-2); min-height: 2rem; display: inline-flex; align-items: center; }
.apt-quick a:hover { border-color: var(--ink-2); color: var(--ink); }
.apt-quick a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-night); }
@media (max-width: 760px) {
  .apt-f-date, .apt-f-sel, .apt-f-grow { flex: 1 1 100%; }
  .apt-f-actions { margin-left: 0; width: 100%; }
  .apt-f-actions .btn { flex: 1; }
}

/* 목록 위 줄(건수 + 정렬) */
.apt-listbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .75rem 1.1rem; border-bottom: 1px solid var(--line); }
.apt-listbar .muted { font-size: .875rem; }

/* 반응형 표: 좁은 화면에서 카드로 */
.apt-table .apt-who b { display: block; font-weight: 700; }
.apt-table .apt-who small { display: block; font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.apt-table td.apt-acts { white-space: nowrap; text-align: right; }
.apt-acts-in { display: inline-flex; gap: .25rem; align-items: center; }
.apt-acts-in form { display: inline; }
.apt-icon-btn { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--r-sm); color: var(--ink-2); }
.apt-icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.apt-icon-btn.is-danger:hover { background: var(--danger-soft); color: var(--danger); }
.apt-title-cell { max-width: 22rem; }
.apt-clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 760px) {
  .apt-table { min-width: 0; }
  .apt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .apt-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .35rem .9rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
  .apt-table tbody tr:last-child { border-bottom: 0; }
  .apt-table tbody td, .apt-table tbody th { display: block; padding: 0; border: 0; text-align: left; }
  .apt-table tbody td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 700; color: var(--ink-3); margin-bottom: 1px; }
  .apt-table .apt-main-cell { grid-column: 1 / -1; }
  .apt-table td.apt-acts { grid-column: 1 / -1; text-align: left; border-top: 1px dashed var(--line); padding-top: .4rem; }
  .apt-table .num { text-align: left; }
  .apt-hide-m { display: none !important; }
}

/* 상세 2단 */
.apt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 1rem; align-items: start; }
.apt-layout > * { min-width: 0; }
@media (max-width: 1100px) { .apt-layout { grid-template-columns: minmax(0, 1fr); } }
.apt-stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.apt-kv { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .65rem 1rem; }
.apt-kv dt { color: var(--ink-3); font-size: .9375rem; }
.apt-kv dd { font-weight: 600; min-width: 0; }
@media (max-width: 560px) {
  .apt-kv { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .apt-kv dd { margin-bottom: .55rem; }
}
.apt-kv-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 2rem; }
@media (max-width: 900px) { .apt-kv-2 { grid-template-columns: minmax(0, 1fr); } }
.apt-headline { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.apt-sub { color: var(--ink-3); font-size: .9375rem; }
.apt-body-text { white-space: normal; line-height: 1.8; color: var(--ink); }
.apt-quote { padding: .9rem 1rem; border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--line); }

/* 신뢰 장치 요약 */
.apt-trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (max-width: 760px) { .apt-trust { grid-template-columns: minmax(0, 1fr); } }
.apt-trust li { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem .85rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-3); }
.apt-trust li .ico-box { width: 2.25rem; height: 2.25rem; }
.apt-trust b { display: block; font-size: .9375rem; }
.apt-trust small { display: block; color: var(--ink-3); font-size: .8125rem; }

/* 이력(타임라인) */
.apt-log { display: flex; flex-direction: column; }
.apt-log li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.apt-log li:last-child { border-bottom: 0; }
.apt-log .apt-dot { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.apt-log .apt-dot .ic { width: .9rem; height: .9rem; }
.apt-log b { font-size: .9375rem; }
.apt-log small { display: block; color: var(--ink-3); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.apt-log p { font-size: .9375rem; color: var(--ink-2); margin-top: 2px; }

/* 서류 */
.apt-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .75rem; }
.apt-doc { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.apt-doc-thumb { display: block; width: 100%; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.apt-doc-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.apt-doc-thumb:hover img, .apt-doc-thumb:focus-visible img { opacity: .85; }
.apt-doc-info { padding: .6rem .75rem; font-size: .875rem; }
.apt-doc-info b { display: block; font-size: .9375rem; }
.apt-doc-info small { display: block; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.apt-viewer { width: min(760px, calc(100% - 32px)); }
.apt-viewer img { width: 100%; height: auto; border-radius: var(--r-sm); background: var(--surface-2); }

/* 판정 선택 */
.apt-decide .seg-opt { flex: 1 1 9rem; }
.apt-done-box { text-align: center; padding: 1.5rem 1rem; }
.apt-done-box .ico-box { margin: 0 auto .75rem; }

/* 평점 분포 */
.apt-dist { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.apt-dist-avg { text-align: center; }
.apt-dist-avg .apt-big { font-size: 2.5rem; font-weight: 850; line-height: 1.1; font-variant-numeric: tabular-nums; }
.apt-dist-avg .apt-big small { font-size: 1rem; color: var(--ink-3); font-weight: 600; }
.apt-dist-rows { display: flex; flex-direction: column; gap: .35rem; }
.apt-dist-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) 7.5rem; gap: .6rem; align-items: center; font-size: .875rem; }
.apt-dist-row .apt-bar { height: .6rem; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.apt-dist-row .apt-bar span { display: block; height: 100%; background: var(--star); border-radius: var(--r-pill); }
.apt-dist-row .num { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .apt-dist { grid-template-columns: minmax(0, 1fr); gap: .75rem; } }
details.apt-fold > summary { cursor: pointer; list-style: none; }
details.apt-fold > summary::-webkit-details-marker { display: none; }
details.apt-fold > summary .apt-fold-ic { transition: transform var(--t-short) var(--ease); }
details.apt-fold[open] > summary .apt-fold-ic { transform: rotate(180deg); }

/* 금액 카드 */
.apt-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 760px) { .apt-money { grid-template-columns: minmax(0, 1fr); } }
.apt-money .stat .v { font-size: 1.5rem; }

/* 사진 */
.apt-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; }
.apt-photos figure { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.apt-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.apt-photos figcaption { position: absolute; left: .4rem; top: .4rem; }

/* 별점 고르기 */
.apt-rate .seg-opt { flex: 1 1 4.5rem; }
.apt-rate .seg-opt span .ic { width: 1rem; height: 1rem; color: var(--star); fill: currentColor; }
.apt-rate .seg-opt input:checked + span .ic { color: var(--warm-soft); }

/* 문의 대화 */
.apt-thread { display: flex; flex-direction: column; gap: .75rem; }
.apt-msg { padding: .85rem 1rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-3); max-width: 92%; }
.apt-msg.is-admin { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-soft); }
.apt-msg-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .8125rem; color: var(--ink-3); margin-bottom: .3rem; }
.apt-msg-head b { color: var(--ink); font-size: .875rem; }
.apt-attach { display: inline-block; width: 10rem; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.apt-attach img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* 운영 메모 */
.apt-memos li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.apt-memos li:last-child { border-bottom: 0; }
.apt-memo-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .8125rem; color: var(--ink-3); }
.apt-memos p { margin-top: .3rem; color: var(--ink); }

/* 시트(주소 있는 모달) */
.apt-sheet-who { display: flex; gap: .75rem; align-items: center; padding: .75rem .9rem; border-radius: var(--r-sm); background: var(--surface-3); border: 1px solid var(--line); }
.apt-sheet-who b { display: block; }
.apt-sheet-who small { display: block; color: var(--ink-3); font-size: .8125rem; }
@media (max-width: 560px) {
  .apt-sheet .sheet-page { padding: 0; place-items: stretch; }
  .apt-sheet .sheet { border-radius: 0; min-height: calc(100vh - 3.5rem); width: 100%; }
}

/* 폼 */
.apt-form-panel { padding: 1.25rem; }
.apt-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 1.25rem; }
@media (max-width: 760px) { .apt-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.apt-area-gu { border: 1px solid var(--line); border-radius: var(--r-sm); padding: .6rem .9rem; }
.apt-area-gu legend { font-weight: 700; font-size: .9375rem; padding: 0 .3rem; }
.apt-area-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0 .75rem; }
.apt-area-list .check { min-height: 2.5rem; padding: .3rem 0; }
.apt-form-foot { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; padding-top: .5rem; }
@media (max-width: 560px) { .apt-form-foot .btn { flex: 1; } }
.apt-count { font-size: .8125rem; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

/* 보조 */
.apt-kv-2 { row-gap: .65rem; }
.apt-kv-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.apt-kv-inline dt { color: var(--ink-3); font-size: .875rem; }
.apt-kv-inline dd { font-weight: 650; margin-right: 1rem; }
.apt-money-col { grid-template-columns: minmax(0, 1fr); }
.apt-tabs { padding: 0 .75rem; }
.apt-tabs .muted { font-weight: 600; font-size: .8125rem; }
.apt-sub.small { font-size: .8125rem; }
