/* ===== YOONS 관리자 페이지 ===== */
.hidden { display: none !important; }

/* 로그인 화면 */
.admin-login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  z-index: 9999;
}
.login-card {
  background: #fff; padding: 48px 40px; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3); width: 380px; text-align: center;
}
.login-logo { font-size: 56px; margin-bottom: 12px; }
.login-card h1 { margin: 0 0 8px; font-size: 24px; color: #1e293b; }
.login-card p { color: #64748b; margin: 0 0 24px; font-size: 14px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input[type=password] {
  padding: 14px 16px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 15px;
}
.login-card button {
  padding: 14px; background: #2563eb; color: white; border: none;
  border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.login-card button:hover { background: #1d4ed8; }
.login-error { color: #dc2626; margin-top: 12px; font-size: 14px; }
.login-back { display: inline-block; margin-top: 20px; color: #64748b; text-decoration: none; font-size: 13px; }

/* 헤더 */
.admin-app { background: #f8fafc; min-height: 100vh; }
.admin-header { background: #1e293b; color: white; padding: 14px 0; }
.admin-header-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.admin-title { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 22px; }
.admin-nav { display: flex; gap: 12px; }
.admin-nav-link {
  color: #cbd5e1; text-decoration: none; padding: 8px 14px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer; font-size: 14px;
}
.admin-nav-link:hover { background: #334155; color: white; }

/* 탭 */
.admin-tabs {
  background: white; border-bottom: 1px solid #e2e8f0;
  display: flex; padding: 0 24px; max-width: 1400px; margin: 0 auto;
  overflow-x: auto;
}
.admin-tab {
  background: transparent; border: none; padding: 14px 18px; cursor: pointer;
  font-size: 14px; color: #475569; font-weight: 500; border-bottom: 3px solid transparent;
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.admin-tab:hover { color: #1e293b; }
.admin-tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: 700; }

/* 메인 */
.admin-main { max-width: 1400px; margin: 0 auto; padding: 24px; }
.admin-section { margin-bottom: 32px; }
.admin-section-title { font-size: 20px; margin: 0 0 16px; color: #1e293b; }
.admin-h3 { font-size: 15px; margin: 0 0 12px; color: #1e293b; font-weight: 600; }
.admin-help { color: #64748b; font-size: 13px; margin: 0 0 12px; }

/* 통계 카드 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat-card { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #e2e8f0; }
.stat-card.stat-pending { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); }
.stat-label { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: #1e293b; }
.stat-sub { font-size: 12px; color: #94a3b8; margin-top: 4px; }

/* 카드 */
.admin-card { background: white; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; }
.admin-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 버튼 */
.admin-btn {
  padding: 9px 16px; background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.admin-btn:hover { background: #e2e8f0; }
.admin-btn-primary { background: #2563eb; color: white; border-color: #2563eb; }
.admin-btn-primary:hover { background: #1d4ed8; }
.admin-btn-danger { background: #dc2626; color: white; border-color: #dc2626; }
.admin-btn-danger:hover { background: #b91c1c; }

/* 라디오 pill */
.radio-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
  border: 1px solid #cbd5e1; border-radius: 24px; cursor: pointer; font-size: 14px;
  background: white;
}
.radio-pill:hover { background: #f1f5f9; }
.radio-pill input[type=radio]:checked + span { color: #2563eb; font-weight: 600; }
.radio-pill:has(input:checked) { border-color: #2563eb; background: #eff6ff; }

/* 토글 */
.switch-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.switch-label input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }

/* 테스트 결과 */
.test-result { margin-top: 12px; }
.result-ok { background: #d1fae5; color: #065f46; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.result-err { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 8px; font-size: 13px; }

/* 비용 테이블 */
.cost-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.cost-table th { background: #f8fafc; padding: 10px; text-align: left; font-size: 13px; color: #475569; border-bottom: 1px solid #e2e8f0; }
.cost-table td { padding: 10px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }

/* 툴바 */
.admin-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: white; padding: 16px; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 16px;
}
.admin-input, .admin-select {
  padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px;
  font-family: inherit; box-sizing: border-box;
}
.admin-input { flex: 1; min-width: 200px; }
.admin-checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #475569; cursor: pointer; }

/* 라벨 (모달 외) */
.admin-card label { display: block; font-size: 13px; color: #475569; font-weight: 600; margin: 0 0 4px; }

/* 테이블 */
.admin-table-wrap { background: white; border-radius: 12px; border: 1px solid #e2e8f0; overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: #f8fafc; padding: 12px; text-align: left; font-size: 13px; color: #475569; border-bottom: 1px solid #e2e8f0; font-weight: 600; }
.admin-table td { padding: 12px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: top; }
.admin-table tr:hover { background: #f8fafc; }
.row-id { color: #94a3b8; font-family: monospace; }
.row-name { font-weight: 500; color: #1e293b; max-width: 400px; word-break: break-word; }
.row-name-ko { color: #2563eb; font-size: 13px; margin-top: 2px; }
.row-name-ko.muted { color: #cbd5e1; font-style: italic; }
.row-clicks { color: #64748b; text-align: right; }
.row-actions { white-space: nowrap; }
.row-btn { background: transparent; border: 1px solid #e2e8f0; padding: 5px 8px; border-radius: 6px; cursor: pointer; margin-right: 2px; font-size: 14px; }
.row-btn:hover { background: #f1f5f9; }
.row-btn-danger:hover { background: #fee2e2; border-color: #fecaca; }
.loading { text-align: center; padding: 40px; color: #94a3b8; }

/* 배지 */
.badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
#tab-pending-badge { background: #dc2626; color: white; padding: 2px 7px; border-radius: 10px; font-size: 11px; margin-left: 4px; }

/* 페이지네이션 */
.admin-pagination { display: flex; gap: 4px; justify-content: center; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.admin-pagination button { padding: 6px 12px; background: white; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; font-size: 13px; }
.admin-pagination button:hover:not(:disabled) { background: #f1f5f9; }
.admin-pagination button.active { background: #2563eb; color: white; border-color: #2563eb; }
.admin-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { margin-left: 12px; color: #64748b; font-size: 13px; }

/* 업로드 검토 */
.uploads-list { display: flex; flex-direction: column; gap: 12px; }
.upload-item { background: white; padding: 16px; border-radius: 10px; border: 1px solid #e2e8f0; }
.upload-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.upload-meta { color: #64748b; font-size: 13px; }
.upload-desc { margin: 10px 0; color: #475569; font-size: 14px; }
.upload-meta-row { font-size: 12px; color: #94a3b8; margin-bottom: 12px; }
.upload-actions { display: flex; gap: 8px; }

/* 모달 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 10000; padding: 20px;
}
.modal-card { background: white; border-radius: 14px; width: 600px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 17px; }
.edit-id { color: #94a3b8; font-family: monospace; font-weight: 400; font-size: 14px; }
.modal-close { background: transparent; border: none; font-size: 18px; cursor: pointer; color: #94a3b8; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body label { display: block; font-size: 13px; color: #475569; font-weight: 600; margin: 12px 0 4px; }
.modal-body input, .modal-body textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 14px; font-family: inherit; box-sizing: border-box;
}
.modal-foot { padding: 14px 20px; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: 8px; }

/* 토스트 */
.yoons-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #1e293b; color: white; padding: 12px 24px; border-radius: 24px;
  font-size: 14px; opacity: 0; transition: all 0.3s; z-index: 10001;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.yoons-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== ADMIN REPORTS ===== */
.report-filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 16px; padding: 12px; background: #f9fafb;
  border-radius: 8px;
}
[data-theme="dark"] .report-filters { background: #1f2937; }
.report-filter {
  padding: 6px 12px; border: 1px solid #d1d5db; border-radius: 16px;
  background: #fff; cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
[data-theme="dark"] .report-filter { background: #374151; color: #e5e7eb; border-color: #4b5563; }
.report-filter.active { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.filter-count {
  background: rgba(0,0,0,0.1); padding: 1px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.report-filter.active .filter-count { background: rgba(255,255,255,0.3); }

.report-list { display: flex; flex-direction: column; gap: 10px; }
.report-card {
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px;
  background: #fff; border-left: 4px solid #94a3b8;
}
[data-theme="dark"] .report-card { background: #1f2937; border-color: #374151; }
.report-status-pending { border-left-color: #f59e0b; }
.report-status-reviewing { border-left-color: #3b82f6; }
.report-status-resolved { border-left-color: #10b981; }
.report-status-ignored { border-left-color: #6b7280; }

.report-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.report-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.report-date { color: #6b7280; }
.report-type-badge, .report-status-badge {
  padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
}
.report-type-badge { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .report-type-badge { background: #422006; color: #fde68a; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-reviewing { background: #dbeafe; color: #1e40af; }
.status-resolved { background: #d1fae5; color: #065f46; }
.status-ignored { background: #f3f4f6; color: #4b5563; }

.report-toggle {
  background: none; border: 1px solid #d1d5db; padding: 3px 10px;
  border-radius: 4px; font-size: 12px; cursor: pointer; color: #6b7280;
}
.report-body { margin-top: 8px; font-size: 13px; }
.report-target-line { margin: 6px 0; display: flex; gap: 12px; flex-wrap: wrap; }
.report-target-line a { color: #3b82f6; text-decoration: none; }
.report-target-line a:hover { text-decoration: underline; }
.report-reporter { color: #6b7280; font-size: 12px; }
.report-preview { color: #4b5563; margin: 6px 0; font-style: italic; }
[data-theme="dark"] .report-preview { color: #9ca3af; }

.report-detail { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e5e7eb; }
.report-full h4 { margin: 0 0 6px; font-size: 13px; color: #374151; }
[data-theme="dark"] .report-full h4 { color: #d1d5db; }
.report-content-full {
  background: #f9fafb; padding: 10px; border-radius: 6px;
  white-space: pre-wrap; font-family: inherit; font-size: 13px; margin: 0 0 12px;
  max-height: 200px; overflow-y: auto;
}
[data-theme="dark"] .report-content-full { background: #111827; color: #e5e7eb; }
.report-info-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  font-size: 12px; margin-bottom: 12px;
}
.report-note-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.report-note-label textarea {
  display: block; width: 100%; margin-top: 4px; padding: 6px 8px;
  border: 1px solid #d1d5db; border-radius: 4px; box-sizing: border-box;
  font-family: inherit; font-size: 13px;
}
.report-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.admin-btn-danger:hover { background: #b91c1c; }

.empty-state {
  padding: 40px; text-align: center; color: #6b7280; font-size: 14px;
  background: #f9fafb; border-radius: 8px;
}
[data-theme="dark"] .empty-state { background: #1f2937; }
.badge.hidden { display: none; }

/* ===== ADMIN SYNC ===== */
.sync-toggle-card { display: flex; justify-content: space-between; align-items: center;
  padding: 20px; background: #f8fafc; border-radius: 12px; margin-bottom: 16px; border: 1px solid #e2e8f0; }
.sync-toggle-info { flex: 1; }
.sync-toggle-label { font-size: 16px; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.sync-toggle-desc { font-size: 13px; color: #64748b; }
.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; transition: .3s; border-radius: 28px; }
.slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px;
  background: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background: #2563eb; }
input:checked + .slider:before { transform: translateX(24px); }

.sync-status-card { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.sync-status-row { display: flex; gap: 12px; padding: 6px 0; }
.sync-status-label { font-weight: 600; color: #475569; min-width: 110px; }

.sync-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.sync-warn { font-size: 12px; color: #d97706; margin-left: auto; }

.sync-log-row { display: grid; grid-template-columns: 160px 100px 80px 1fr 60px;
  gap: 12px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; font-size: 13px; align-items: center; }
.sync-log-row:hover { background: #f8fafc; }
.sync-log-time { color: #64748b; font-family: monospace; }
.sync-log-status { font-weight: 600; }
.sync-log-trigger { color: #475569; }
.sync-log-summary { color: #334155; }
.sync-log-dur { color: #94a3b8; text-align: right; font-family: monospace; }

@media (max-width: 768px) {
  .sync-log-row { grid-template-columns: 1fr; gap: 4px; padding: 12px; }
  .sync-actions { flex-wrap: wrap; }
  .sync-warn { margin-left: 0; }
}

/* ===== 번역 진행률 탭 (progress.html에서 통합) ===== */
.progress-meta { color: #808090; font-size: 0.9rem; margin-bottom: 24px; }
.progress-meta span { color: #ff7a45; font-weight: 600; }
.progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.progress-card { background: #1a1a2a; border: 1px solid #2a2a3a; border-radius: 12px; padding: 20px; }
.progress-card h3 { font-size: 1.1rem; margin: 0 0 16px; color: #e8e8f0; }
.progress-table { width: 100%; border-collapse: collapse; }
.progress-table th, .progress-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #2a2a3a; font-size: 0.9rem; }
.progress-table th { color: #808090; font-weight: 500; font-size: 0.8rem; text-transform: uppercase; }
.progress-bar { background: #2a2a3a; border-radius: 6px; height: 8px; overflow: hidden; min-width: 100px; }
.progress-bar-fill { background: linear-gradient(90deg, #ff7a45, #ffb088); height: 100%; transition: width 0.5s; }
.progress-pct { font-weight: 600; color: #ff7a45; min-width: 50px; display: inline-block; }
.progress-pct.done { color: #4ade80; }
.progress-auto-refresh { color: #4ade80; font-size: 0.85rem; }

@media (max-width: 768px) {
  .progress-grid { grid-template-columns: 1fr; }
}
