/* ==========================================================================
   growth-cat-report.css — 탭3 카테고리별 누적 모음 (A4 세로, 카드 그리드)
   판형: 210×297mm. 화면 = 컨테이너 padding, 인쇄 = @page margin.
   팔레트: 네이비 #1e3a8a / #1e40af
   ========================================================================== */

/* @page 규칙은 성장 기록 탭2(growth-age-report.css)에서 이미 선언됨 — 중복 선언 불필요.
   탭3도 같은 A4 세로 설정을 공유함. */

/* ==========================================================================
   탭3 패널 구조 — 상단 툴바 + 스크롤 래퍼 + 문서
   ========================================================================== */
#growthTabCatReport {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #e5e7eb;
}

/* 상단 툴바 (화면 전용) — 탭2와 같은 패턴, 클래스만 분리 */
.growth-ct-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  border-bottom: 1px solid #d1d5db;
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.growth-ct-topbar-title {
  font-size: 17px;
  font-weight: 800;
  color: #1f2937;
  letter-spacing: -0.3px;
}
.growth-ct-topbar-sum {
  font-size: 14px;
  color: #6b7280;
  flex: 1;
}
.growth-ct-topbar-sum span {
  font-size: 18px;
  font-weight: 800;
  color: #1e3a8a;
  margin-right: 2px;
}

/* 스크롤 래퍼 */
.growth-ct-doc-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 60px;
  background: #e5e7eb;
}

/* A4 세로 문서 컨테이너 */
.growth-ct-doc {
  max-width: 210mm;
  margin: 0 auto;
  padding: 14mm 16mm;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
  color: #1f2937;
  font-family: inherit;
}

/* ==========================================================================
   히어로 블록 (누적 합계)
   ========================================================================== */
.ct-hero {
  background: #f8faff;
  border: 1px solid #dbeafe;
  border-left: 4px solid #1e40af;
  padding: 18px 22px;
  margin-bottom: 20px;
  border-radius: 4px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.ct-hero-label {
  font-size: 11pt;
  color: #64748b;
  font-weight: 500;
}
.ct-hero-value {
  font-size: 28pt;
  font-weight: 800;
  color: #1e3a8a;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ct-hero-unit {
  font-size: 13pt;
  color: #1e3a8a;
  font-weight: 600;
  margin-left: -6px;
}

/* ==========================================================================
   카드 그리드
   ========================================================================== */
.ct-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ct-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 10px 12px;
  break-inside: avoid;
  page-break-inside: avoid;
  background: #fff;
}
.ct-card-span2 { grid-column: span 2; }

.ct-card-hdr {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid #f3f4f6;
}
.ct-card-name {
  font-size: 11pt;
  font-weight: 700;
  color: #1e3a8a;
}
.ct-card-count {
  font-size: 13pt;
  font-weight: 800;
  color: #1f2937;
  font-variant-numeric: tabular-nums;
}
.ct-card-count-unit {
  font-size: 9pt;
  color: #6b7280;
  font-weight: 500;
  margin-left: 2px;
}
.ct-card-words {
  font-size: 12pt;
  line-height: 1.7;
  color: #000;
  font-weight: 500;
}

/* ==========================================================================
   빈 상태
   ========================================================================== */
.ct-empty {
  margin: 60px auto;
  max-width: 420px;
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 1.5px dashed #d1d5db;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.ct-empty-icon { font-size: 42px; margin-bottom: 12px; }
.ct-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}
.ct-empty-sub {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.55;
}

/* ==========================================================================
   인쇄 모드
   ========================================================================== */
@media print {
  body { background: white; }

  .nav-bar, .growth-anon-banner, .growth-tabbar-wrap,
  .growth-ct-topbar { display: none !important; }

  #screen-growth,
  #screen-growth .growth-tab-panel,
  #growthTabCatReport,
  .growth-ct-doc-wrap {
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    height: auto !important;
    border: none !important;
    overflow: visible !important;
  }
  .growth-ct-doc {
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  /* 색 보존 */
  .ct-hero, .ct-card-name, .ct-card-count, .ct-card {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
