/* 코코포인트몰 관리자 CSS */
.point-admin {
  --pad: 16px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: calc(60px + 16px) var(--pad) 100px;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.point-admin *, .point-admin *::before, .point-admin *::after {
  box-sizing: border-box;
}

.point-admin-header {
  margin-bottom: 20px;
}
.point-admin-header h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}
.point-admin-header .sub {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

/* 통계 카드 그리드 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}
.stat-card .label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-card .value {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
}
.stat-card.highlight .value {
  color: #ea580c;
}
.stat-card.primary .value {
  color: #2563eb;
}

/* 상단 네비게이션 탭 */
.point-tabs {
  position: sticky;
  top: 60px;
  z-index: 20;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--pad) * -1) 20px;
  padding: 10px var(--pad);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  scrollbar-width: none;
}
.point-tabs::-webkit-scrollbar {
  display: none;
}
.point-tabs button {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.point-tabs button:hover {
  background: #f3f4f6;
  color: #111827;
}
.point-tabs button.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

/* 탭 패널 */
.point-panel {
  display: none;
}
.point-panel.active {
  display: block;
}

/* 공통 카드 */
.content-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}
.content-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}
.content-card-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 툴바 & 필터 */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.search-input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  min-width: 220px;
  outline: none;
}
.search-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.filter-select {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
  outline: none;
}

/* 버튼 */
.btn {
  border: 0;
  background: #111827;
  color: #ffffff;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
}
.btn:hover {
  background: #1f2937;
}
.btn:active {
  transform: scale(0.98);
}
.btn.secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}
.btn.secondary:hover {
  background: #e5e7eb;
}
.btn.primary {
  background: #2563eb;
  color: #ffffff;
}
.btn.primary:hover {
  background: #1d4ed8;
}
.btn.danger {
  background: #ef4444;
  color: #ffffff;
}
.btn.danger:hover {
  background: #dc2626;
}
.btn.warning {
  background: #f59e0b;
  color: #ffffff;
}
.btn.success {
  background: #10b981;
  color: #ffffff;
}
.btn.small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
}

/* 반응형 테이블 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  min-width: 680px;
}
.admin-table th {
  background: #f9fafb;
  padding: 12px 14px;
  font-weight: 700;
  color: #4b5563;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
  color: #374151;
}
.admin-table tbody tr:hover {
  background: #fcfdfe;
}
.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

/* 뱃지 */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.badge-earn {
  background: #dbeafe;
  color: #1e40af;
}
.badge.badge-use {
  background: #fee2e2;
  color: #991b1b;
}
.badge.badge-revoke {
  background: #fef3c7;
  color: #92400e;
}
.badge.badge-cancel {
  background: #e0e7ff;
  color: #3730a3;
}
.badge.badge-active {
  background: #d1fae5;
  color: #065f46;
}
.badge.badge-inactive {
  background: #f3f4f6;
  color: #6b7280;
}
.badge.badge-pending {
  background: #ffedd5;
  color: #9a3412;
}
.badge.badge-completed {
  background: #dcfce7;
  color: #166534;
}

/* 상품 카드 그리드 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.product-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  transition: transform 0.15s, box-shadow 0.15s;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}
.product-card-img-wrap {
  position: relative;
  width: 100%;
  height: 150px;
  background: #f3f4f6;
  overflow: hidden;
}
.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
}
.product-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-card-category {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  margin-bottom: 4px;
}
.product-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
  margin: 0 0 6px;
  line-height: 1.35;
}
.product-card-price {
  font-size: 16px;
  font-weight: 900;
  color: #ea580c;
  margin-bottom: 8px;
}
.product-card-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-meta {
  font-size: 11px;
  color: #9ca3af;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #f3f4f6;
  padding-top: 8px;
  margin-bottom: 10px;
}
.product-card-actions {
  display: flex;
  gap: 6px;
}

/* 모달 레이어 */
.admin-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.admin-modal-overlay.show {
  display: flex;
}
.admin-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}
.admin-modal-lg {
  max-width: 760px;
}
.admin-modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #111827;
}
.modal-close-btn {
  border: 0;
  background: transparent;
  font-size: 22px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover {
  color: #111827;
}
.admin-modal-body {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}
.admin-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #f9fafb;
  border-radius: 0 0 16px 16px;
}

/* 폼 컨트롤 */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.form-group .form-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}
.quick-amount-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.quick-amount-btn {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #4b5563;
  cursor: pointer;
}
.quick-amount-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* 토스트 알림 */
.site-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: rgba(17, 24, 39, 0.95);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  z-index: 10001;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.site-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 모바일 반응형 */
@media (max-width: 640px) {
  .point-admin {
    padding: calc(60px + env(safe-area-inset-top, 0px) + 12px) 12px calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .point-admin-header h2 {
    font-size: 20px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    margin-bottom: 16px;
  }
  .stat-card {
    padding: 12px 10px;
    border-radius: 12px;
  }
  .stat-card .label {
    font-size: 11px;
    margin-bottom: 4px;
    gap: 4px;
  }
  .stat-card .value {
    font-size: 18px;
  }
  .point-tabs {
    top: calc(60px + env(safe-area-inset-top, 0px));
    margin: 0 -12px 16px;
    padding: 8px 12px 10px;
    gap: 6px;
  }
  .point-tabs button {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 38px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .content-card {
    padding: 14px 12px;
    border-radius: 12px;
  }
  .content-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .content-card-header h3 {
    font-size: 15px;
  }
  .toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }
  .toolbar .filter-select,
  .toolbar .search-input {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    font-size: 14px;
    height: 42px;
  }
  .toolbar .btn {
    flex: 1 1 0;
    height: 42px;
    font-size: 13.5px;
    padding: 0 10px;
  }
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
  }
  .admin-table {
    min-width: 650px;
  }
  .admin-table th, .admin-table td {
    padding: 10px 8px;
    font-size: 12px;
    white-space: nowrap;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .admin-modal-overlay {
    padding: 10px;
    align-items: flex-end;
  }
  .admin-modal {
    max-height: 88vh;
    border-radius: 18px 18px 12px 12px;
  }
  .admin-modal-body {
    padding: 16px 14px;
  }
  .admin-modal-footer {
    padding: 12px 14px;
    gap: 8px;
  }
  .admin-modal-footer .btn {
    flex: 1;
    min-height: 42px;
  }
}
