/* RFID 물품관리 시스템 공통 스타일 */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", 
               "Malgun Gothic", "맑은 고딕", sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* 스크롤바 슬림하게 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* 토스트 애니메이션 */
@keyframes toast-in {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast {
  animation: toast-in 0.3s ease-out;
  min-width: 280px;
}

/* 모달 오버레이 */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

/* 카드 호버 */
.card-hover {
  transition: all 0.2s ease;
}
.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 모바일 하단 네비 */
.mobile-nav-fixed {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 0.5rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 40;
}

/* 카메라 영역 */
#qr-reader, #ocr-camera {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
}
#qr-reader video { 
  width: 100% !important; 
  border-radius: 12px;
}

/* 상태 배지 */
.badge-utilized { background: #dcfce7; color: #166534; }
.badge-shortage { background: #fee2e2; color: #991b1b; }
.badge-surplus { background: #fef3c7; color: #92400e; }
.badge-pending { background: #dbeafe; color: #1e40af; }
.badge-confirmed { background: #dcfce7; color: #166534; }
.badge-rejected { background: #f3f4f6; color: #4b5563; }

/* 테이블 셀 */
table.data-table th { 
  background: #f8fafc; 
  font-weight: 600; 
  color: #475569; 
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
table.data-table td { 
  padding: 0.75rem 1rem; 
  border-bottom: 1px solid #f1f5f9;
}
table.data-table tr:hover td { background: #f8fafc; }

/* 정렬 가능 헤더: 클릭 영역 시각화 */
table.data-table th.sortable-th {
  transition: background-color 0.15s;
  user-select: none;
}
table.data-table th.sortable-th:active {
  background: #dbeafe;
}
table.data-table th.sortable-th .sort-arrow {
  display: inline-block;
  min-width: 1em;
  text-align: center;
}

/* sticky thead가 흰 배경에서 살짝 들려 보이게 */
table.data-table thead.sticky th {
  background: #f8fafc;
}

/* 입력 박스 */
.input-field {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: white;
  font-size: 0.875rem;
}
.input-field:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 사이드바 활성 */
.sidebar-link.active {
  background: linear-gradient(to right, #2563eb, #1d4ed8);
  color: white;
}

/* 진행바 */
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(to right, #3b82f6, #1d4ed8);
  transition: width 0.3s ease;
}

/* 큰 버튼 (모바일용) */
.btn-large {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
}

/* 빈 상태 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
}
.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* 모바일 검색 입력 */
input[type="text"], input[type="number"], input[type="password"], textarea, select {
  -webkit-appearance: none;
  appearance: none;
}

/* 인쇄 */
@media print {
  .no-print { display: none !important; }
  body { background: white !important; }
}

/* 대장 비교 분석 — 버튼 스타일 */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: #7c3aed;
  color: white;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.btn-primary:hover { background: #6d28d9; }
.btn-primary:disabled { background: #c4b5fd; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  background: #e5e7eb;
  color: #374151;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.btn-secondary:hover { background: #d1d5db; }

.btn-tab {
  padding: 0.375rem 0.75rem;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}
.btn-tab:hover { background: #e5e7eb; }
.btn-tab-active {
  padding: 0.375rem 0.75rem;
  background: #7c3aed;
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  border: 1px solid #7c3aed;
  cursor: pointer;
  font-weight: 500;
}
