/* pointshop/style.css (BC Mint Theme) */
:root {
  --mint: #20b7a7;
  --mint2: #15a596;
  --mint-soft: rgba(32, 183, 167, .12);
  --dark: #0f172a;
  --text: #0b1220;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --shadow: 0 10px 26px rgba(15, 23, 42, .10);
  --radius: 14px;

  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, .12);
  --blue: #3b82f6;
}

/* =========================================================
   1. 레이아웃 및 공통
   ========================================================= */
.gs-wrap, .ps-wrap {
  max-width: 1180px;
  margin: 16px auto 60px;
  padding: 0 14px;
  font-family: Pretendard, 'Noto Sans KR', sans-serif;
  color: var(--text);
}

/* =========================================================
   2. 필독사항 (상단 박스)
   ========================================================= */
.gs-req-wrap, .ex-req-wrap { margin: 14px 0 18px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; overflow: hidden; }
.gs-req-head, .ex-req-head { background: #2f2f2f; color: #fff; text-align: center; font-weight: 900; padding: 14px 10px; font-size: 16px; letter-spacing: -.2px; }
.gs-req-grid, .ex-req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px; }
.gs-req-item, .ex-req-item { border: 1px solid rgba(239, 68, 68, .12); border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; background: #fff; box-shadow: 0 10px 22px rgba(15, 23, 42, .05); }
.gs-req-badge, .ex-req-badge { font-weight: 1000; font-size: 12px; letter-spacing: -.2px; padding: 8px 10px; border-radius: 999px; background: #0f172a; color: #fff; min-width: 56px; text-align: center; }
.gs-req-txt, .ex-req-txt { font-weight: 900; color: #111827; line-height: 1.35; }
.gs-req-txt b, .ex-req-txt b { font-weight: 1000; }
.gs-req-txt .dot, .ex-req-txt .dot { font-weight: 1000; margin-right: 8px; }

/* 필독사항 색상 테마 */
.gs-req-p1, .ex-req-p1 { border-color: rgba(14, 165, 163, .35); } .gs-req-p1 .gs-req-badge, .ex-req-p1 .ex-req-badge { background: #0ea5a3; } .gs-req-p1 .dot, .ex-req-p1 .dot { color: #0ea5a3; }
.gs-req-p2, .ex-req-p2 { border-color: rgba(59, 130, 246, .35); } .gs-req-p2 .gs-req-badge, .ex-req-p2 .ex-req-badge { background: #3b82f6; } .gs-req-p2 .dot, .ex-req-p2 .dot { color: #3b82f6; }
.gs-req-p3, .ex-req-p3 { border-color: rgba(245, 158, 11, .35); } .gs-req-p3 .gs-req-badge, .ex-req-p3 .ex-req-badge { background: #f59e0b; } .gs-req-p3 .dot, .ex-req-p3 .dot { color: #f59e0b; }
.gs-req-p4, .ex-req-p4 { border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .04); } .gs-req-p4 .gs-req-badge, .ex-req-p4 .ex-req-badge { background: #ef4444; } .gs-req-p4 .dot, .ex-req-p4 .dot { color: #ef4444; }
.gs-req-p5, .ex-req-p5 { border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .06); } .gs-req-p5 .ex-req-badge, .ex-req-p5 .ex-req-badge { background: #22c55e; } .gs-req-p5 .dot, .ex-req-p5 .dot { color: #22c55e; }

@media (max-width:720px) { 
    .gs-req-grid, .ex-req-grid { grid-template-columns: 1fr; } 
    .gs-req-item, .ex-req-item { padding: 13px 14px; } 
    .gs-req-head, .ex-req-head { font-size: 15px; } 
    .gs-req-badge, .ex-req-badge { min-width: 54px; font-size: 11px; padding: 7px 9px; } 
}

/* =========================
   3. 인덱스 리스트 (카드)
   ========================= */
.ps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* PC 4개 */
  gap: 16px;
}
@media (max-width:1100px) {
  .ps-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width:560px) {
  .ps-grid { grid-template-columns: repeat(2, 1fr); } /* 모바일 2개 */
  .ps-wrap { padding: 0 10px; }
}

/* 카드 본체 */
.ps-card {
  border: 2px solid var(--mint);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  position: relative;
  /* 배지 잘림 방지 */
  overflow: visible !important; 
  z-index: 1;
}

/* 카드 헤더 (상단 둥글게) */
.ps-card .ps-head {
  background: linear-gradient(135deg, var(--mint), var(--mint2));
  color: #fff;
  font-weight: 1000;
  padding: 12px 14px;
  font-size: 18px;
  letter-spacing: -.2px;
  position: relative;
  /* 상단 모서리 둥글게 */
  border-radius: 12px 12px 0 0 !important;
}
.ps-card .ps-head:after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(500px 120px at 10% 0%, rgba(255, 255, 255, .28), transparent 55%);
  pointer-events: none;
  border-radius: 12px 12px 0 0; /* 배경 효과도 둥글게 */
}

/* 이미지 영역 */
.ps-card .ps-img {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: #fff;
  min-height: 170px;
}
.ps-card .ps-img img {
  max-width: 86%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .12));
}

.ps-card .ps-meta {
  padding: 12px 14px 14px;
}

/* 교환가격 라인 */
.ps-price {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 6px 0 10px;
}
.ps-price .label {
  background: var(--dark);
  color: #fff;
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 900;
  font-size: 13px;
}
.ps-price .val {
  margin-left: auto;
  font-weight: 1000;
  color: var(--mint2);
  font-size: 18px;
}

/* 버튼 */
.ps-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  text-align: center;
  border: 2px solid rgba(32, 183, 167, .45);
  background: linear-gradient(180deg, #ffffff, #f7fffe);
  color: var(--text);
  font-weight: 1000;
  padding: 12px 10px;
  border-radius: 12px;
  text-decoration: none;
  transition: .15s ease;
  box-sizing: border-box; /* 패딩 포함 크기 계산 */
}
.ps-btn:hover {
  border-color: var(--mint);
  box-shadow: 0 10px 22px rgba(32, 183, 167, .18);
  transform: translateY(-1px);
}
.ps-btn .ico { opacity: .7 }

/* 관리자 알림 배지 */
.admin-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ef4444;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    min-width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    z-index: 20;
}

/* =========================
   4. 상세페이지 (View)
   ========================= */
.ps-view {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
  margin-top: 12px;
}
@media (max-width:980px) { .ps-view { grid-template-columns: 1fr; } }

/* 왼쪽 큰 이미지 카드 */
.ps-bigimg {
  border: 2px solid var(--mint);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}
.ps-bigimg .img {
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}
.ps-bigimg img {
  max-width: 86%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, .12));
}
.ps-bigimg .timer {
  background: linear-gradient(135deg, var(--mint), var(--mint2));
  color: #fff;
  font-weight: 1000;
  padding: 14px 16px;
  text-align: center;
}

/* 오른쪽 정보 패널 */
.ps-panel {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  border: 1px solid var(--line);
}
.ps-panel .row {
  display: grid;
  grid-template-columns: 170px 1fr;
  border-top: 1px solid var(--line);
}
.ps-panel .row:first-child { border-top: 0; }

.ps-panel .th {
  background: linear-gradient(180deg, #0f172a, #111c33);
  color: #fff;
  font-weight: 1000;
  padding: 16px;
}
.ps-panel .td {
  padding: 16px;
  font-weight: 900;
  color: #111827;
}
.ps-panel .td .big {
  font-size: 22px;
  font-weight: 1000;
  color: var(--mint2);
}

/* 액션 영역 (버튼들) */
.ps-actions, .ps-actions-big {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: stretch; /* 높이 맞춤 */
}
.ps-actions form, .ps-actions-big form { margin: 0; display:flex; flex:1; }

/* 버튼 공통 스타일 */
.btn-apply, .btn-list, .ps-actions button, .ps-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 1000;
  cursor: pointer;
  transition: .15s ease;
  height: 54px; /* 높이 고정 */
  box-sizing: border-box;
  font-size: 16px;
  text-decoration: none;
}

/* 신청 버튼 (민트) */
.btn-apply, .ps-actions button {
  width: 100%;
  border: 0;
  background: var(--mint);
  color: #fff;
}
.btn-apply:hover, .ps-actions button:hover {
  background: var(--mint2);
  box-shadow: 0 10px 20px rgba(32, 183, 167, .25);
  transform: translateY(-1px);
}
.btn-apply.disabled, .ps-actions button:disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
}

/* 목록 버튼 (흰색) */
.btn-list, .ps-actions a.btn-list {
  background: #fff;
  border: 2px solid var(--mint);
  color: var(--text);
  min-width: 120px;
}
.btn-list:hover {
  background: #f0fdfc;
  border-color: var(--mint2);
  transform: translateY(-1px);
}

/* 안내문 */
.ps-note, .ps-notice {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
  color: var(--muted);
}
.ps-notice.red { color: var(--red); }
.ps-notice.gray { color: var(--muted); }


/* =========================
   5. 리스트 테이블 & 배지
   ========================= */
.ps-tablewrap {
  margin-top: 16px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.ps-tabletitle {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 1000;
  color: #0b1220;
  background: linear-gradient(180deg, #ffffff, #f7fffe);
}
.ps-table {
  width: 100%;
  border-collapse: collapse;
}
.ps-table th, .ps-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: center;
}
.ps-table th {
  background: linear-gradient(135deg, var(--mint), var(--mint2));
  color: #fff;
  font-weight: 1000;
}

.ps-actbox {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.ps-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 1000;
  font-size: 12px;
  letter-spacing: -.2px;
  white-space: nowrap;
}
.ps-badge.req { background: rgba(59, 130, 246, .10); color: #2563eb; border: 1px solid rgba(59, 130, 246, .22); }
.ps-badge.done { background: rgba(32, 183, 167, .12); color: var(--mint2); border: 1px solid rgba(32, 183, 167, .25); }
.ps-badge.deny { background: var(--red-soft); color: var(--red); border: 1px solid rgba(239, 68, 68, .28); }
.ps-badge.cancel { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

/* 미니 버튼 */
.ps-btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  color: #ef4444;
  border: 1px solid #ef4444;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: .2s;
}
.ps-btn-cancel:hover { background: #fef2f2; }

.ps-mini {
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 1000;
  font-size: 11px;
  border: 1px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
}
.ps-mini.red { border-color: rgba(239, 68, 68, .45); color: #ef4444; background: #fff5f5; }
.ps-mini.blue { border-color: rgba(59, 130, 246, .35); color: #2563eb; background: #eff6ff; }
.ps-mini.gray { color: #94a3b8; cursor: not-allowed; }


/* =========================
   6. 모달 스타일 (공통)
   ========================= */
.ps-modal { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, .55); align-items: center; justify-content: center; padding: 16px; }
.ps-modal.on { display: flex; }
.ps-modal-card { width: 520px; max-width: 100%; background: #fff; border-radius: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); overflow: hidden; }
.ps-modal-head { padding: 16px 18px; border-bottom: 1px solid #eef2f7; display: flex; align-items: center; justify-content: space-between; }
.ps-modal-title { font-size: 18px; font-weight: 1000; margin: 0; }
.ps-modal-x { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; cursor: pointer; font-size: 18px; font-weight: 1000; }
.ps-modal-body { padding: 16px 18px; }

.ps-field { border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.ps-field .k { font-size: 12px; font-weight: 1000; color: #64748b; margin-bottom: 6px; }
.ps-field .v { font-size: 14px; font-weight: 1000; color: #0f172a; word-break: break-all; }

.ps-modal-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ps-modal-actions .btn { flex: 1; min-width: 150px; padding: 12px 14px; border-radius: 14px; font-weight: 1000; border: 1px solid #e2e8f0; cursor: pointer; background: #fff; height: 54px; display:flex; align-items:center; justify-content:center; }
.ps-modal-actions .btn.done { background: var(--mint); border-color: var(--mint); color: #fff; box-shadow: 0 10px 22px rgba(32, 183, 167, .25); }
.ps-modal-actions .btn.close { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }


/* =========================
   7. 모바일 레이아웃 최적화
   ========================= */
@media (max-width: 640px) {
  
  /* 상세페이지 버튼 세로 정렬 + 두께 보장 */
  .ps-actions, .ps-actions-big {
    flex-direction: column; 
    gap: 10px; 
    margin-top: 16px;
  }
  .btn-apply, .btn-list, .ps-actions button, .ps-actions a {
    width: 100% !important;
    height: 54px !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .ps-actions-big form { width:100%; }

  /* 테이블을 카드형으로 변환 */
  .ps-table thead { display: none; }
  .ps-table, .ps-table tbody, .ps-table tr, .ps-table td { display: block; width: 100%; }
  
  .ps-table tr {
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 5px 15px rgba(0,0,0,.03);
    overflow: hidden;
  }

  .ps-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 16px;
    font-size: 14px;
  }
  .ps-table td:last-child { border-bottom: 0; }

  .ps-table td:before {
    content: attr(data-label);
    font-weight: 1000;
    color: #64748b;
    margin-right: 10px;
    text-align: left;
    font-size: 13px;
  }

  /* 테이블 헤더 라벨 매칭 */
  .ps-table td:nth-child(1):before { content: "번호"; }
  .ps-table td:nth-child(2):before { content: "신청자"; }
  .ps-table td:nth-child(3):before { content: "교환금액"; }
  .ps-table td:nth-child(4):before { content: "신청날짜"; }
  .ps-table td:nth-child(5):before { content: "처리현황"; }

  /* 1번(번호) 숨김 */
  .ps-table td:nth-child(1) { display: none; }

  /* 처리현황 정렬 */
  .ps-table td:nth-child(5) {
    flex-wrap: wrap;
    background: #f8fafc;
  }
  .ps-actbox {
    width: 100%;
    justify-content: flex-end;
    gap: 6px;
  }
}

/* 모바일 카드 리스트 (2열 유지) */
@media (max-width: 560px) {
  .ps-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px;
  }
  .ps-card .ps-head { font-size: 14px; padding: 10px; }
  .ps-card .ps-img { padding: 8px; min-height: 0; }
  .ps-card .ps-meta { padding: 10px; }
  
  .ps-price { display: block; margin: 4px 0 8px; }
  .ps-price .label { width: 100%; display: flex; justify-content: center; margin-bottom: 4px; padding: 6px; }
  .ps-price .val { display: flex; justify-content: center; font-size: 16px; }
  
  .ps-btn { padding: 10px; font-size: 13px; }
}

/* [추가] 모달 내 이미지 가운데 정렬 */
.ps-modal-body img {
    display: block;
    margin: 0 auto 16px; /* 위쪽 여백 0, 좌우 자동(가운데), 아래쪽 여백 16px */
}

/* ... 기존 P1 ~ P5 스타일 유지 ... */

/* [추가] P6 (보라색/인디고 테마 - 보증업체 안내용) */
.ex-req-p6 { border-color: rgba(99, 102, 241, .35); background: rgba(99, 102, 241, .04); }
.ex-req-p6 .ex-req-badge { background: #6366f1; }
.ex-req-p6 .dot { color: #6366f1; }

/* [수정] 모달 이미지 강제 가운데 정렬 */
.ps-modal-body img {
    display: block !important;
    margin: 0 auto 16px !important;
}

/* [추가] 인덱스 카드 이미지 링크 가운데 정렬 보정 */
.ps-card .ps-img a {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

/* [추가] 관리자 지갑확인 모달 스타일 */
.admin-wallet-box {
    display: flex;
    gap: 8px;
    align-items: center;
}
.admin-wallet-box input {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-weight: 900;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    width: 100%; /* 너비 꽉 차게 */
}
.btn-copy {
    background: #3b82f6;
    color: #fff;
    border: 0;
    padding: 0 16px;
    height: 42px; /* input 높이와 맞춤 */
    border-radius: 10px;
    font-weight: 900;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: .2s;
}
.btn-copy:hover { background: #2563eb; }

/* [수정/추가] 관리자 모달 스타일 */

/* 닉네임, 금액, 지갑주소 등을 보여주는 박스 */
.admin-value-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    font-size: 16px;
    font-weight: 1000;
    color: #0f172a;
    word-break: break-all; /* 긴 지갑주소 줄바꿈 */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 관리자 액션 버튼들 (완료/불가/닫기) */
.btn-admin-act {
    flex: 1;
    height: 50px;
    border-radius: 12px;
    font-weight: 1000;
    font-size: 15px;
    cursor: pointer;
    border: 0;
    color: #fff;
    transition: .2s;
}
.btn-admin-act.done { background: #22c55e; box-shadow: 0 4px 12px rgba(34,197,94,.3); } /* 초록 */
.btn-admin-act.deny { background: #ef4444; box-shadow: 0 4px 12px rgba(239,68,68,.3); } /* 빨강 */
.btn-admin-act.close { background: #f1f5f9; color: #64748b; border: 1px solid #cbd5e1; } /* 회색 */

.btn-admin-act:hover { transform: translateY(-2px); filter: brightness(1.05); }

/* 복사 버튼 (작게) */
.btn-mini-copy {
    background: #3b82f6;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    margin-left: 10px;
    flex-shrink: 0;
}