/**
 * Claude / AI UI — Q&A·이슈 센터 공통. 토큰으로 테마(쿨·웜·다크)와 대비 정렬.
 */
body.erp-atlas {
  --ai-accent-from: #6d28d9;
  --ai-accent-to: #8b5cf6;
  --ai-accent-text-on: #ffffff;
  --ai-panel-radius: 16px;
  --ai-panel-border: rgba(139, 92, 246, 0.42);
  --ai-panel-surface: linear-gradient(135deg, rgba(109, 40, 217, 0.07), rgba(139, 92, 246, 0.05));
  --ai-panel-header-border: rgba(139, 92, 246, 0.22);
  --ai-panel-header-bg: rgba(109, 40, 217, 0.09);
  --ai-title-fg: var(--text);
  --ai-close-fg: var(--muted);
  --ai-body-fg: var(--text);
  --ai-focus-ring: rgba(139, 92, 246, 0.55);
}

body.erp-atlas[data-theme="dark"] {
  --ai-panel-border: rgba(167, 139, 250, 0.55);
  --ai-panel-surface: linear-gradient(135deg, rgba(109, 40, 217, 0.14), rgba(139, 92, 246, 0.08));
  --ai-panel-header-border: rgba(167, 139, 250, 0.35);
  --ai-panel-header-bg: rgba(109, 40, 217, 0.18);
  --ai-focus-ring: rgba(196, 181, 253, 0.75);
}

body.erp-atlas[data-theme="warm"] {
  --ai-panel-border: rgba(109, 40, 217, 0.38);
}

/* Primary CTA — AI 분석 / 이슈 요약 */
.erp-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none !important;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ai-accent-text-on) !important;
  background: linear-gradient(135deg, var(--ai-accent-from), var(--ai-accent-to)) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.erp-ai-btn:focus-visible {
  outline: 2px solid var(--ai-focus-ring);
  outline-offset: 2px;
}

.erp-ai-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

/* 패널: 기본 숨김 — .is-visible 시 표시 (JS classList) */
.erp-ai-panel {
  display: none;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: var(--ai-panel-radius);
  border: 1.5px solid var(--ai-panel-border);
  background: var(--ai-panel-surface);
}

.erp-ai-panel.is-visible {
  display: block;
}

.erp-ai-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ai-panel-header-border);
  background: var(--ai-panel-header-bg);
}

.erp-ai-panel__header--compact {
  padding: 10px 18px;
}

.erp-ai-panel__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ai-title-fg);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.erp-ai-panel__close {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ai-close-fg);
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}

.erp-ai-panel__close:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

body.erp-atlas[data-theme="dark"] .erp-ai-panel__close:hover {
  background: rgba(255, 255, 255, 0.08);
}

.erp-ai-panel__body {
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ai-body-fg);
  min-height: 60px;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.erp-ai-panel__body--issue {
  font-size: 13.5px;
  line-height: 1.8;
  max-height: 280px;
}

/* 관리자 로그 래퍼 — 기본 숨김 */
.qa-admin-log-wrap.is-visible {
  display: block;
}

.qa-admin-log-wrap {
  display: none;
}
