/**
 * index.html 전용: 요약 뷰 타이틀 정렬, 보고서 표 줄무늬 폴백, 비활성 뷰 content-visibility.
 * (구 index.html 인라인 <style> 이전)
 */
/*
  요약(#view-summary) 메인 타이틀: erp-atlas-skin 전용 키커·h2가 다른 뷰와 달라 보이던 것을
  베이스 디자인 시스템·다크/웜 키커와 동일하게 맞춤. (#view-summary 는 3044 그룹에서 빠져 있던 padding-top/margin-top 도 보정)
*/
body.erp-atlas:not(.main-summary-mode) #view-summary .section-title {
  padding-top: 2px !important;
  margin-top: 4px !important;
}
body.erp-atlas:not(.main-summary-mode) #view-summary > .section:first-child > .section-title {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
/* 키커: 조직 등 다른 뷰와 같이 산세리프 라벨 + 기본 키커 바(스킨의 요약 전용 세리프·테라와 구분) */
body.erp-atlas:not(.main-summary-mode) #view-summary .section-title .section-kicker {
  font-family: var(--atlas-font-sans) !important;
  font-size: var(--ds-font-xs) !important;
  font-weight: 900 !important;
  letter-spacing: 0.10em !important;
  text-transform: uppercase !important;
  color: var(--primary) !important;
}
body.erp-atlas:not(.main-summary-mode) #view-summary .section-title .section-kicker::before {
  width: 14px !important;
  height: 2px !important;
}
body.erp-atlas:not(.main-summary-mode) #view-summary .section-title h2 {
  font-family: var(--atlas-font-display) !important;
  font-size: var(--ds-font-xl) !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
}
/* 다크: 거래처 등과 동일 — 베이스 .section-kicker 인디고 (스킨의 요약 전용 테라 키커 덮어씀) */
body.erp-atlas[data-theme="dark"]:not(.main-summary-mode) #view-summary .section-title .section-kicker {
  color: #818cf8 !important;
}
body.erp-atlas[data-theme="dark"]:not(.main-summary-mode) #view-summary .section-title .section-kicker::before {
  background: linear-gradient(90deg, #4f46e5 0%, #818cf8 100%) !important;
}
/* 쿨톤(white): 스카이 키커 — 클래식 화이트(warm)는 var(--primary) 테라 */
body.erp-atlas[data-theme="white"]:not(.main-summary-mode) #view-summary .section-title .section-kicker {
  color: #0369a1 !important;
}
body.erp-atlas[data-theme="white"]:not(.main-summary-mode) #view-summary .section-title .section-kicker::before {
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%) !important;
}
body.erp-atlas:not([data-theme]):not(.main-summary-mode) #view-summary .section-title .section-kicker {
  color: #0369a1 !important;
}
body.erp-atlas:not([data-theme]):not(.main-summary-mode) #view-summary .section-title .section-kicker::before {
  background: linear-gradient(90deg, #0284c7 0%, #38bdf8 100%) !important;
}

/* 요약도 조직과 동일 클래스(org-title-one-line) — base는 #view-organization 만 타겟하므로 여기서 #view-summary 동일 규칙 */
body.erp-atlas:not(.main-summary-mode) #view-summary .section-title.org-title-one-line {
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 16px !important;
}
body.erp-atlas:not(.main-summary-mode) #view-summary .section-title.org-title-one-line > div:first-child {
  flex-shrink: 0 !important;
  min-width: 0 !important;
}
body.erp-atlas:not(.main-summary-mode) #view-summary .section-title.org-title-one-line .org-level-picker-wrap {
  margin-bottom: 0 !important;
  flex-shrink: 0 !important;
}
body.erp-atlas:not(.main-summary-mode) #view-summary .section-title.org-title-one-line > p {
  flex: 1 !important;
  min-width: 0 !important;
  margin: 0 !important;
  text-align: right !important;
}
body.erp-atlas:not(.main-summary-mode) #view-summary .summary-secondary .org-level-picker-wrap--placeholder {
  flex-shrink: 0 !important;
  width: min(220px, 32vw) !important;
  min-height: 1px !important;
  margin: 0 !important;
  pointer-events: none !important;
}
@media (max-width: 900px) {
  body.erp-atlas:not(.main-summary-mode) #view-summary .section-title.org-title-one-line {
    flex-wrap: wrap !important;
  }
  body.erp-atlas:not(.main-summary-mode) #view-summary .section-title.org-title-one-line > p {
    flex: 1 1 100% !important;
    text-align: left !important;
  }
}

/* 보고서 줄무늬: erp-report-classic-table.css에서 동일 규칙 선언 중 → 중복 제거 */
/* 비활성 뷰: 브라우저가 레이아웃·페인트를 건너뛰어 대용량 DOM에서 탭 전환·필터 후 메인 스레드 부담 완화 */
body.erp-atlas .view:not(.active) {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

/* ========================================================================== */
/* 본문 타이포 단일 소스 (커버/메인요약/헤더/툴바 제외)                           */
/* ========================================================================== */
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) {
  --body-rule-section-title-size: 24px;
  --body-rule-section-title-line: 1.15;
  --body-rule-section-title-weight: 800;
  --body-rule-section-subtitle-size: 16px;
  --body-rule-section-subtitle-line: 1.35;
  --body-rule-section-subtitle-weight: 600;
  --body-rule-card-title-size: 22px;
  --body-rule-card-title-line: 1.2;
  --body-rule-card-title-weight: 800;
  --body-rule-card-meta-size: 16px;
  --body-rule-card-meta-line: 1.35;
  --body-rule-card-meta-weight: 600;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode)
  main > .view:not(#view-cover):not(#view-main-summary) > .section > .section-title h2 {
  font-size: var(--body-rule-section-title-size) !important;
  line-height: var(--body-rule-section-title-line) !important;
  font-weight: var(--body-rule-section-title-weight) !important;
  margin: 0 !important;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode)
  main > .view:not(#view-cover):not(#view-main-summary) > .section > .section-title > p,
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) .section-title .report-title-desc,
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) .section-title .qa-title-desc {
  font-size: var(--body-rule-section-subtitle-size) !important;
  line-height: var(--body-rule-section-subtitle-line) !important;
  font-weight: var(--body-rule-section-subtitle-weight) !important;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode)
  main > .view:not(#view-cover):not(#view-main-summary) .panel > .panel-head h3 {
  font-size: var(--body-rule-card-title-size) !important;
  line-height: var(--body-rule-card-title-line) !important;
  font-weight: var(--body-rule-card-title-weight) !important;
  margin: 0 !important;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode)
  main > .view:not(#view-cover):not(#view-main-summary) .panel > .panel-head .meta {
  font-size: var(--body-rule-card-meta-size) !important;
  line-height: var(--body-rule-card-meta-line) !important;
  font-weight: var(--body-rule-card-meta-weight) !important;
  margin: 0 !important;
}

/* 페이지별 예외는 레이아웃만 유지하고 타이포는 공통 규칙을 상속 */
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report .report-title-desc,
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-feedback .section-title.feedback-title-one-line > p {
  max-width: 72ch !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Q&A 헤더 P0: 설명 문장 줄바꿈(2행 레이아웃과 맞춤) */
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-qa .qa-title-desc {
  max-width: min(72ch, 100%) !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
}

/* 관리자 보고서: 타이틀 행 풀폭 + 기간·연도 필터 뷰 우측 끝 (다른 페이지 section-title-filters와 동일) */
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) main > .view#view-report > .section > .section-title.report-title-compact {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode) main > .view#view-report > .section > .section-title.report-title-compact .report-title-head,
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) main > .view#view-report-admin2 > .admin2-report-sheet > .section-title.report-title-compact .report-title-head {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report .report-title-compact .report-title-top,
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report-admin2 .report-title-compact .report-title-top {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  gap: 12px !important;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report .report-title-compact .report-title-main,
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report-admin2 .report-title-compact .report-title-main {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: baseline !important;
  gap: 10px 14px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report .report-title-main .report-title-text,
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report-admin2 .report-title-main .report-title-text {
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report .report-title-top .section-title-filters,
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report-admin2 .report-title-top .section-title-filters {
  margin-left: 0 !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}

/* 관리자2: 구간 필터 등 항목 많음 — 줄바꿈·최소폭 */
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report-admin2 .admin2-report-filters.section-title-filters {
  margin-left: 0 !important;
  flex: 0 1 auto !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px 10px !important;
}

/* 관리자2: 본문 가로 전체 사용(중앙 1200px 캡 등 재발 방지) */
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report-admin2 {
  width: 100% !important;
  max-width: 100% !important;
}
body.erp-atlas:not(.cover-mode):not(.main-summary-mode) #view-report-admin2 .admin2-report-sheet {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
