/* ============================================================
   관리자 화면 — 모바일에서도 사진 교체·이름 수정이 쉽도록
   (gold.css 뒤에 로드. .ad-* 에만 적용)
   ============================================================ */

/* 사진은 자르지 않고 전체가 보이게 */
.ad-check-photo {
  aspect-ratio: 1 / 1;
  background: #0a0807;
}

.ad-check-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ad-thumb-btn img,
.ad-thumb > img,
.ad-thumb-btn > span,
.ad-thumb > span {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #0a0807;
}

.ad-thumb-btn {
  border: 1px solid rgba(233, 200, 126, 0.24);
  border-radius: 12px;
}

.ad-thumb-btn:hover {
  border-color: rgba(233, 200, 126, 0.6);
}

/* ---------- 모바일 ---------- */

@media (max-width: 720px) {
  .ad-bar-in {
    width: calc(100% - 20px);
    gap: 8px;
    padding: 8px 0;
  }

  .ad-bar-actions .btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* 탭은 가로 스크롤 + 손가락으로 누르기 쉽게 */
  .ad-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    margin: 12px 0;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .ad-tabs::-webkit-scrollbar {
    display: none;
  }

  .ad-tabs button {
    flex: none;
    padding: 10px 14px;
    font-size: 13px;
    min-height: 40px;
  }

  /* 상단 제목 + 저장 버튼을 붙여 둔다 */
  .ad-toolbar {
    position: sticky;
    top: 50px;
    z-index: 18;
    margin: 0 -10px;
    padding: 8px 10px;
    background: rgba(7, 6, 5, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(233, 200, 126, 0.16);
    align-items: center;
  }

  .ad-toolbar h2 {
    font-size: 16px;
  }

  .ad-toolbar-actions {
    width: 100%;
    gap: 6px;
  }

  .ad-toolbar-actions .btn {
    flex: 1;
    min-height: 44px;
    font-size: 13px;
  }

  .ad-hint {
    font-size: 12px;
    margin: 10px 0 12px;
  }

  /* 출근 체크: 3열, 사진은 정사각 */
  .ad-check-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .ad-check {
    border-radius: 10px;
  }

  .ad-check-photo {
    font-size: 22px;
  }

  .ad-check-name {
    font-size: 11.5px;
    margin-top: 5px;
  }

  .ad-check-state {
    font-size: 10px;
  }

  /* 명단 편집: 사진 + 입력칸을 위아래로 */
  .ad-row {
    grid-template-columns: 92px 1fr;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
  }

  .ad-thumb {
    gap: 5px;
  }

  .ad-thumb-actions {
    flex-direction: column;
  }

  .ad-thumb-actions .mini {
    min-height: 32px;
    font-size: 11px;
  }

  /* iOS 확대 방지 + 누르기 쉬운 입력칸 */
  .input,
  .select,
  .textarea,
  .mini {
    font-size: 16px;
  }

  .input,
  .select {
    min-height: 44px;
    padding: 10px 12px;
  }

  .textarea {
    min-height: 90px;
  }

  .field > span {
    font-size: 11.5px;
  }

  .ad-grid2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ad-row-foot {
    gap: 8px;
  }

  .ad-check-inline {
    min-height: 40px;
    font-size: 13px;
  }

  .ad-check-inline input {
    width: 20px;
    height: 20px;
  }

  .ad-order .mini {
    min-width: 44px;
    min-height: 40px;
  }

  /* 저장 바: 홈 인디케이터 위로 */
  .ad-savebar {
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: calc(100% - 20px);
    padding: 10px 12px;
    gap: 8px;
  }

  .ad-savebar .btn {
    min-height: 44px;
    padding: 0 16px;
  }

  .ad-savebar span,
  .ad-savebar b {
    font-size: 12px;
  }

  .ad-panel {
    padding-bottom: 110px;
  }

  .ad-toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    text-align: center;
  }
}
