/* Simple.css 보완 스타일 */
:root {
  --tab-active: #1a73e8;
  --success: #2e7d32;
  --error: #c62828;
  --warning: #e65100;
  --border: #ddd;
  --bg-card: #fafafa;
}

/* 탭 네비게이션 */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--tab-active);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #555;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--tab-active);
  background: rgba(26, 115, 232, 0.05);
}

.tab-btn.active {
  color: var(--tab-active);
  border-bottom-color: var(--tab-active);
}

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

/* 설정 바 */
.config-bar {
  display: flex;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.config-bar label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.config-bar input { min-width: 280px; }

/* API 섹션 */
.api-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
}

.api-section h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* 폼 */
.form-row {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.form-row label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: #555;
}

.form-row input,
.form-row select,
.form-row textarea {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.9rem;
  min-width: 140px;
}

/* 버튼 */
.form-row button,
.api-section > button {
  padding: 0.5rem 1rem;
  background: var(--tab-active);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  white-space: nowrap;
}

.form-row button:hover,
.api-section > button:hover { opacity: 0.85; }

.btn-primary {
  padding: 0.5rem 1rem;
  background: var(--tab-active);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-primary:hover { opacity: 0.85; }

.btn-lg {
  padding: 0.7rem 2rem;
  font-size: 1rem;
  font-weight: 600;
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  background: #666;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-sm:hover { opacity: 0.85; }

.btn-remove {
  padding: 0.3rem 0.6rem;
  background: var(--error);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

/* 응답 영역 */
.result-area {
  margin-top: 0.75rem;
  max-height: 400px;
  overflow: auto;
}

.result-area pre {
  margin: 0;
  padding: 0.75rem;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}

.result-header {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0;
}

.result-header.success { color: var(--success); }
.result-header.error { color: var(--error); }

/* 상품 그리드 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.product-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.product-card .product-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.product-card .product-sku {
  font-size: 0.75rem;
  color: #888;
}

.product-card .product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tab-active);
}

.product-card button {
  margin-top: 0.3rem;
  padding: 0.4rem;
  background: var(--tab-active);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.product-card button:hover { opacity: 0.85; }

/* 장바구니 */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.cart-table th,
.cart-table td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.cart-table th {
  font-size: 0.8rem;
  color: #666;
  font-weight: 600;
}

.cart-summary {
  font-size: 0.95rem;
  padding: 0.5rem 0;
  flex: 1;
}

.badge {
  background: var(--tab-active);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

/* 주문 카드 */
.order-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: #fff;
  transition: box-shadow 0.15s;
}

.order-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.order-card.pending {
  border-left: 4px solid var(--warning);
}

.order-card.admin-order {
  cursor: pointer;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.order-id {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--tab-active);
  cursor: pointer;
}

.order-id:hover { text-decoration: underline; }

.order-card-body {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #555;
  flex-wrap: wrap;
}

.order-amount {
  font-weight: 600;
  color: #222;
}

.order-date {
  color: #999;
  font-size: 0.8rem;
}

.order-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* 주문 상태 */
.order-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.status-PAYMENT_PENDING { background: #fff3e0; color: #e65100; }
.status-PAYMENT_COMPLETED { background: #e8f5e9; color: #2e7d32; }
.status-PREPARING { background: #e3f2fd; color: #1565c0; }
.status-SHIPPED { background: #e3f2fd; color: #1565c0; }
.status-DELIVERED { background: #e8f5e9; color: #2e7d32; }
.status-CONFIRMED { background: #f3e5f5; color: #7b1fa2; }
.status-CANCELLED { background: #fce4ec; color: #c62828; }
.status-CANCEL_REQUESTED { background: #fff3e0; color: #e65100; }

/* 상세 그리드 */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.detail-field-wide {
  grid-column: 1 / -1;
}

.id-full {
  font-family: monospace;
  font-size: 0.85rem;
  word-break: break-all;
  user-select: all;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.detail-field label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
}

.detail-field span {
  font-size: 0.9rem;
}

/* 아이템 테이블 */
.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.items-table th,
.items-table td {
  padding: 0.4rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.items-table th {
  font-size: 0.75rem;
  color: #666;
  font-weight: 600;
  background: #f5f5f5;
}

/* 배송 카드 */
.shipment-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: #fff;
}

/* 토스트 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  animation: toast-in 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 서브탭 */
.sub-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #ccc;
  margin-bottom: 1.25rem;
}

.sub-tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #777;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}

.sub-tab-btn:hover {
  color: var(--tab-active);
}

.sub-tab-btn.active {
  color: var(--tab-active);
  border-bottom-color: var(--tab-active);
}

.sub-tab-panel { display: none; }
.sub-tab-panel.active { display: block; }

/* 상품 상태 */
.product-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.status-on { background: #e8f5e9; color: #2e7d32; }
.status-off { background: #fff3e0; color: #e65100; }

.btn-cancel {
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--error);
  border: 1px solid var(--error);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-cancel:hover { background: #fce4ec; }

.btn-warning {
  padding: 0.5rem 1rem;
  background: var(--warning);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-warning:hover { opacity: 0.85; }

/* 재고 요약 */
.stock-summary {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem 0;
  flex-wrap: wrap;
}

.stock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.stock-label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
}

.stock-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
}

.stock-value.good { color: var(--success); }
.stock-value.warn { color: var(--warning); }

/* 거래 유형 */
.txn-type {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.type-INBOUND { background: #e8f5e9; color: #2e7d32; }
.type-RESERVE { background: #fff3e0; color: #e65100; }
.type-DEDUCT { background: #fce4ec; color: #c62828; }
.type-RELEASE { background: #e3f2fd; color: #1565c0; }
.type-RESTORE { background: #f3e5f5; color: #7b1fa2; }
.type-ADJUST { background: #e0f2f1; color: #00695c; }
.type-SUSPEND { background: #fff3e0; color: #e65100; }
.type-UNSUSPEND { background: #e3f2fd; color: #1565c0; }

/* 반품 카드 (고객용) */
.return-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: #fff;
}

/* 반품 진행 바 */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.progress-step {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #f5f5f5;
  color: #999;
}

.progress-step.done {
  background: #e8f5e9;
  color: #2e7d32;
}

.progress-step.current {
  background: var(--tab-active);
  color: #fff;
  font-weight: 600;
}

.progress-step.rejected {
  background: #fce4ec;
  color: #c62828;
  font-weight: 600;
}

.progress-arrow {
  color: #ccc;
  font-size: 0.75rem;
}

/* 반품 인라인 폼 */
.return-inline-form {
  border: 1px solid var(--warning);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background: #fff8f0;
}

/* 반품 상태 */
.return-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.status-rt-REQUESTED { background: #fff3e0; color: #e65100; }
.status-rt-COLLECTING { background: #e3f2fd; color: #1565c0; }
.status-rt-COLLECTED { background: #e3f2fd; color: #1565c0; }
.status-rt-INSPECTED { background: #f3e5f5; color: #7b1fa2; }
.status-rt-APPROVED { background: #e8f5e9; color: #2e7d32; }
.status-rt-REJECTED { background: #fce4ec; color: #c62828; }
.status-rt-COMPLETED { background: #e8f5e9; color: #2e7d32; }

/* 반품 아이템 */
.return-items-section {
  margin: 0.5rem 0;
}

.return-item-row {
  align-items: end;
}

.btn-add-item {
  margin-top: 0.25rem;
  padding: 0.35rem 0.8rem;
  background: transparent;
  color: var(--tab-active);
  border: 1px dashed var(--tab-active);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
}

.btn-add-item:hover {
  background: rgba(26, 115, 232, 0.05);
}

/* 결제 상태 */
.pay-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.status-pay-PENDING { background: #fff3e0; color: #e65100; }
.status-pay-PROCESSING { background: #e3f2fd; color: #1565c0; }
.status-pay-COMPLETED { background: #e8f5e9; color: #2e7d32; }
.status-pay-FAILED { background: #fce4ec; color: #c62828; }
.status-pay-CANCELLED { background: #f5f5f5; color: #616161; }

/* 환불 상태 */
.refund-status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.status-rf-PENDING { background: #fff3e0; color: #e65100; }
.status-rf-COMPLETED { background: #e8f5e9; color: #2e7d32; }
.status-rf-FAILED { background: #fce4ec; color: #c62828; }

/* 환불 유형 */
.refund-type {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.type-rf-ORDER_CANCEL { background: #fce4ec; color: #c62828; }
.type-rf-RETURN { background: #f3e5f5; color: #7b1fa2; }

/* 유틸 */
.empty-message {
  text-align: center;
  color: #999;
  padding: 1.5rem;
  font-size: 0.9rem;
}

.loading {
  text-align: center;
  color: #666;
  padding: 1rem;
}

h2 {
  margin-top: 0;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

h4 {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.9rem;
  color: #333;
}

/* 상품 이미지 */
.product-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  background: #f0f0f0;
}

.product-thumb-empty {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 4px;
  color: #ccc;
  font-size: 0.8rem;
}

.img-thumb-sm {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 3px;
}

.image-gallery {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.image-card {
  position: relative;
  width: 120px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.image-card.primary {
  border: 2px solid var(--tab-active);
}

.image-card img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}

.primary-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--tab-active);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-weight: 600;
}

.img-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  min-width: auto;
}
