/* ============ 공통 커스텀 스타일 ============ */
html, body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
*::-webkit-scrollbar { height: 6px; width: 6px; }
*::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 8px; }

/* 페이지 전환 시 살짝 페이드인 */
.fade-in { animation: fadeIn .35s ease-out both; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 드래그앤드롭 업로드 영역 */
.dropzone {
  border: 2px dashed #cbd5e1;
  transition: all .15s ease;
}
.dropzone.drag-over {
  border-color: #2563eb;
  background-color: #eff6ff;
}
.dropzone:hover {
  border-color: #93c5fd;
  background-color: #f8fafc;
}

/* 상태 배지 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .72rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.badge-submitted { background:#e2e8f0; color:#334155; }
.badge-reviewing { background:#fef3c7; color:#92400e; }
.badge-action_needed { background:#fee2e2; color:#b91c1c; }
.badge-approved { background:#dcfce7; color:#15803d; }

/* 관리자 테이블 상태 select 배경 컬러 동기화 */
select.status-select.st-submitted { background-color:#e2e8f0; color:#334155; }
select.status-select.st-reviewing { background-color:#fef3c7; color:#92400e; }
select.status-select.st-action_needed { background-color:#fee2e2; color:#b91c1c; }
select.status-select.st-approved { background-color:#dcfce7; color:#15803d; }

/* 테이블 스티키 헤더 (모바일 가로스크롤 대응) */
.admin-table-wrap { -webkit-overflow-scrolling: touch; }
.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* 텍스트 말줄임 */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 로딩 스피너 버튼 내부 */
.btn-spinner {
  width: 1rem; height: 1rem;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 토스트 */
#toast-root {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: calc(100% - 2rem);
  max-width: 380px;
  align-items: center;
}
.toast {
  width: 100%;
  background: #0f172a;
  color: #fff;
  padding: .65rem 1rem;
  border-radius: .75rem;
  font-size: .85rem;
  box-shadow: 0 8px 20px rgba(0,0,0,.18);
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: toastIn .25s ease-out both;
}
.toast.toast-error { background:#b91c1c; }
.toast.toast-success { background:#15803d; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.55);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
}
.modal-panel {
  background: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 1.25rem 1.25rem 0 0;
  animation: modalUp .25s ease-out both;
}
@media (min-width: 640px) {
  .modal-panel { border-radius: 1rem; }
}
@keyframes modalUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 파일 미리보기 카드 */
.file-preview {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: #f1f5f9;
  border-radius: .75rem;
  padding: .5rem .65rem;
}
.file-preview img.thumb {
  width: 2.5rem; height: 2.5rem;
  object-fit: cover;
  border-radius: .5rem;
  flex-shrink: 0;
}
.file-preview .file-icon {
  width: 2.5rem; height: 2.5rem;
  border-radius: .5rem;
  background: #dbeafe;
  color: #2563eb;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
