/* 2026-04-06 어드민 대시보드 스타일 */
/* 2026-04-13 라이트 모드 전환, 대비 강화, 글자 단계 통일 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Noto Sans KR', sans-serif;
  background: #f5f6f8; color: #1a1a1a;
  min-height: 100vh;
}

/* ── 헤더 ── */
.header {
  background: #fff;
  border-bottom: 1px solid #e0e3e8;
  padding: 0 24px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.header-title { font-size: 17px; font-weight: 700; color: #1a1a1a; letter-spacing: 0.5px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-user { font-size: 13px; color: #666; }
.btn-logout {
  padding: 6px 14px; background: none;
  border: 1px solid #d0d4da; border-radius: 6px;
  color: #666; font-size: 12px; font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.btn-logout:hover { border-color: #e06c75; color: #e06c75; }

/* ── 레이아웃 ── */
.layout {
  display: flex; height: calc(100vh - 56px);
}

/* ── 사이드바 ── */
.sidebar {
  width: 260px; min-width: 260px;
  background: #fff;
  border-right: 1px solid #e0e3e8;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-header {
  padding: 16px 18px;
  border-bottom: 1px solid #e0e3e8;
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-title { font-size: 12px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-add-conf {
  width: 28px; height: 28px;
  background: #f0f2ff; border: 1px solid #c5cbf5;
  border-radius: 6px; color: #4a5ae8;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.btn-add-conf:hover { background: #e0e4ff; }
.conf-list {
  flex: 1; overflow-y: auto; padding: 4px 0;
}
.conf-list::-webkit-scrollbar { width: 3px; }
.conf-list::-webkit-scrollbar-thumb { background: #d0d4da; border-radius: 2px; }
.conf-item {
  padding: 12px 18px; cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  display: flex; justify-content: space-between; align-items: center;
}
.conf-item:hover { background: #f5f6f8; }
.conf-item.active { background: #f0f2ff; border-left-color: #4a5ae8; }
.conf-name { font-size: 14px; font-weight: 500; color: #333; }
.conf-item.active .conf-name { color: #1a1a1a; font-weight: 600; }
.conf-count {
  font-size: 11px; color: #888;
  background: #f0f1f3;
  padding: 2px 8px; border-radius: 10px;
}
.conf-item.active .conf-count { background: #dde1ff; color: #4a5ae8; }

/* ── 메인 영역 ── */
.main {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: #f5f6f8;
}
.main-header {
  padding: 20px 28px;
  background: #fff;
  border-bottom: 1px solid #e0e3e8;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px;
}
.main-title { font-size: 20px; font-weight: 700; color: #1a1a1a; }
.main-desc { font-size: 12px; color: #888; margin-top: 4px; }
.main-actions { display: flex; gap: 8px; }
.btn {
  padding: 8px 16px;
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  font-family: inherit; cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.btn-primary { background: #4a5ae8; color: #fff; }
.btn-primary:hover { background: #3a4ad8; }
.btn-danger { background: #fff0f0; color: #d94452; border: 1px solid #f5c6cb; }
.btn-danger:hover { background: #ffe0e0; }
.btn-secondary { background: #fff; color: #555; border: 1px solid #d0d4da; }
.btn-secondary:hover { background: #f5f6f8; }
.btn svg { width: 16px; height: 16px; }

/* ── PDF 목록 ── */
.pdf-list {
  flex: 1; overflow-y: auto; padding: 20px 28px;
}
.pdf-list::-webkit-scrollbar { width: 4px; }
.pdf-list::-webkit-scrollbar-thumb { background: #d0d4da; border-radius: 2px; }
.pdf-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: #aaa; gap: 12px;
}
.pdf-empty-icon { font-size: 48px; opacity: 0.3; }
.pdf-empty-text { font-size: 14px; }

.pdf-card {
  background: #fff; border: 1px solid #e0e3e8;
  border-radius: 10px; padding: 18px 20px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.pdf-card:hover { border-color: #c5cbf5; }
/* 2026-04-13 카드 접기/펼치기 */
.pdf-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.pdf-card-header:hover .pdf-title { color: #4a5ae8; }
.card-toggle-icon {
  color: #bbb; font-size: 14px; line-height: 32px;
  width: 20px; text-align: center; flex-shrink: 0;
}
.pdf-card-body { padding-top: 12px; }
.pdf-title-wrap { flex: 1; margin-right: 12px; }
.pdf-title {
  font-size: 15px; font-weight: 600; color: #1a1a1a;
  margin-bottom: 4px;
}
.pdf-original { font-size: 11px; color: #999; }
.pdf-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-icon {
  width: 32px; height: 32px;
  background: #f5f6f8; border: 1px solid #e0e3e8;
  border-radius: 6px; color: #666;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.btn-icon:hover { background: #eee; color: #333; }
.btn-icon.danger:hover { background: #fff0f0; color: #d94452; border-color: #f5c6cb; }
.btn-icon svg { width: 16px; height: 16px; }

.pdf-url-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.pdf-url-label { font-size: 11px; color: #888; flex-shrink: 0; width: 70px; font-weight: 500; }
.pdf-url-input {
  flex: 1; padding: 7px 10px;
  background: #f8f9fa; border: 1px solid #e0e3e8;
  border-radius: 6px; color: #333;
  font-size: 13px; font-family: 'Courier New', monospace;
  outline: none; transition: border-color 0.2s;
}
.pdf-url-input:focus { border-color: #4a5ae8; }
.pdf-url-preview {
  font-size: 11px; color: #4a5ae8;
  cursor: pointer; flex-shrink: 0;
  text-decoration: none;
}
.pdf-url-preview:hover { text-decoration: underline; }

.pdf-title-input {
  flex: 1; padding: 7px 10px;
  background: #f8f9fa; border: 1px solid #e0e3e8;
  border-radius: 6px; color: #333;
  font-size: 13px; font-family: inherit;
  outline: none; transition: border-color 0.2s;
}
.pdf-title-input:focus { border-color: #4a5ae8; }

.pdf-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 11px; color: #888;
}
.pdf-public {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
}
.pdf-public input { accent-color: #4a5ae8; cursor: pointer; }

.btn-save-pdf {
  padding: 5px 12px;
  background: #f0f2ff; border: 1px solid #c5cbf5;
  border-radius: 5px; color: #4a5ae8;
  font-size: 11px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-save-pdf:hover { background: #e0e4ff; }

/* ── 빈 상태 ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; color: #aaa; text-align: center;
}
.empty-state-title { font-size: 16px; margin-bottom: 8px; color: #888; }
.empty-state-desc { font-size: 13px; color: #bbb; }

/* ── 모달 ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border: 1px solid #e0e3e8;
  border-radius: 12px; padding: 28px;
  width: 100%; max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-title { font-size: 18px; font-weight: 700; color: #1a1a1a; margin-bottom: 20px; }
.modal .form-group { margin-bottom: 16px; }
.modal .form-group label {
  display: block; font-size: 12px; font-weight: 500;
  color: #666; margin-bottom: 6px;
}
.modal .form-group input,
.modal .form-group textarea {
  width: 100%; padding: 10px 12px;
  background: #f8f9fa; border: 1px solid #e0e3e8;
  border-radius: 8px; color: #333;
  font-size: 13px; font-family: inherit;
  outline: none; transition: border-color 0.2s;
}
.modal .form-group input:focus,
.modal .form-group textarea:focus { border-color: #4a5ae8; }
.modal .form-group textarea { resize: vertical; min-height: 60px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-error { color: #d94452; font-size: 12px; margin-top: 8px; }

/* ── 업로드 영역 ── */
.upload-zone {
  border: 2px dashed #d0d4da;
  border-radius: 10px; padding: 32px;
  text-align: center; cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: #4a5ae8;
  background: #f5f6ff;
}
.upload-zone-icon { font-size: 36px; color: #bbb; margin-bottom: 8px; }
.upload-zone-text { font-size: 13px; color: #888; }
.upload-zone-hint { font-size: 11px; color: #bbb; margin-top: 4px; }
.upload-file-list { margin-top: 12px; }
.upload-file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: #f8f9fa;
  border-radius: 6px; margin-bottom: 6px;
  font-size: 12px; color: #555;
}
.upload-progress {
  height: 3px; background: #e0e3e8; border-radius: 2px; margin-top: 12px; overflow: hidden;
}
.upload-progress-bar {
  height: 100%; background: #4a5ae8; border-radius: 2px;
  width: 0; transition: width 0.3s;
}

/* ── 토스트 ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #fff; border: 1px solid #e0e3e8;
  border-radius: 8px; padding: 12px 20px;
  font-size: 13px; color: #333;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  z-index: 2000;
  transform: translateY(100px); opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid #2ecc71; }
.toast.error { border-left: 3px solid #d94452; }

/* ── 개별 논문 섹션 ── */
.papers-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #eee;
}
.papers-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.papers-title {
  font-size: 12px; font-weight: 600; color: #888;
}
.btn-upload-papers {
  padding: 4px 10px;
  background: #f0faf5; border: 1px solid #b5e8cb;
  border-radius: 5px; color: #2ecc71;
  font-size: 11px; font-family: inherit; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.btn-upload-papers:hover { background: #e0f5eb; }
.papers-list { display: flex; flex-direction: column; gap: 4px; }
.paper-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 5px;
  font-size: 12px; color: #555;
}
.paper-item-info {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 0;
}
.paper-item-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.paper-item-size { flex-shrink: 0; color: #999; font-size: 11px; }
.paper-item-link {
  flex-shrink: 0; color: #4a5ae8; text-decoration: none; font-size: 11px;
  margin-right: 8px;
}
.paper-item-link:hover { text-decoration: underline; }
.paper-item-delete {
  flex-shrink: 0; width: 22px; height: 22px;
  background: none; border: none; color: #bbb;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: all 0.2s;
}
.paper-item-delete:hover { background: #fff0f0; color: #d94452; }
.papers-empty {
  font-size: 11px; color: #bbb; padding: 8px 0;
}
.papers-drop-zone {
  border: 1px dashed #d0d4da; border-radius: 6px;
  padding: 12px; text-align: center;
  font-size: 11px; color: #999;
  cursor: pointer; transition: all 0.2s;
  display: none;
}
.papers-drop-zone.open { display: block; }
.papers-drop-zone.dragover { border-color: #2ecc71; background: #f0faf5; }
.papers-drop-zone input[type="file"] { display: none; }
.papers-uploading { font-size: 11px; color: #2ecc71; padding: 6px 0; }

/* ── 목차 입력 영역 ── */
.toc-textarea {
  width: 100%; padding: 10px 12px;
  background: #f8f9fa; border: 1px solid #e0e3e8;
  border-radius: 6px; color: #333;
  font-size: 12px; font-family: inherit; line-height: 1.6;
  outline: none; resize: vertical;
  transition: border-color 0.2s;
}
.toc-textarea:focus { border-color: #4a5ae8; }
.toc-textarea::placeholder { color: #bbb; }
.toc-actions {
  display: flex; gap: 8px; margin-top: 8px; margin-bottom: 8px;
}
.toc-preview {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 4px;
}
.toc-list {
  display: flex; flex-direction: column; gap: 4px;
}
