:root {
  --bg-gradient: linear-gradient(180deg, #f5f5f7 0%, #e8e8ed 100%);
  --card-bg: #ffffff;
  --card-border: #e5e5ea;
  --text-main: #1c1c1e;
  --text-muted: #8e8e93;
  /* 관리자 웹(--accent: #ffd400 + --accent-ink: #0a0a0a)과 완전히 같은 "병아리 노랑 +
     검정" 톤으로 맞춘다. 이렇게 밝은 노랑은 흰 글자와 거의 안 보일 정도로 대비가
     안 나와서(WCAG 대비 1.4:1), 노란 배경 위 글자는 전부 --accent-ink(검정, 대비
     13.8:1)를 쓴다. --accent-yellow-dark는 흰/연노랑 배경 위에 "노란 계열 텍스트"가
     필요할 때(라벨, 차트 선 등)만 쓰는 진한 골드 — 밝은 노랑 그대로 텍스트로 쓰면
     흰 배경에서 거의 안 보인다. */
  --accent-yellow: #ffd400;
  --accent-yellow-light: #fff6cc;
  --accent-yellow-dark: #8f6c00;
  --accent-ink: #0a0a0a;
  --accent-green: #34c759;
  --accent-amber: #ff9f0a;
  --accent-rose: #ff3b30;
  --input-bg: #f2f2f7;
  --radius-lg: 14px;
  --radius-md: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  padding: 16px;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 90px;
}

.hidden { display: none !important; }

/* ===== 상단 탭(주간 보고 / 주간 현황) ===== */
.app-tab-nav {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.tab-nav-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab-nav-btn.active {
  background: var(--accent-yellow);
  color: var(--accent-ink);
}

/* ===== Filter Card Header ===== */
.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.week-title-badge { display: flex; align-items: center; }
.week-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--accent-yellow-dark);
}

/* 이번주/저번주 토글 버튼 — 누를 때마다 라벨이 지금 보고 있는 주차로 바뀐다(이번주 보는
   중이면 "이번주", 저번주로 넘어가면 "저번주"). filter-header가 space-between이라 자연히
   week-title-badge 반대쪽(오른쪽) 끝에 붙는다. */
.week-toggle-btn {
  background: var(--input-bg);
  border: none;
  border-radius: 999px;
  color: var(--accent-yellow-dark);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.week-toggle-btn:active {
  opacity: 0.7;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Filter Grid */
.filter-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 520px) {
  .filter-grid-3 { gap: 6px; }
  .filter-grid-3 .form-select { padding: 10px 8px; font-size: 13px; }
}

.filter-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .filter-grid-4 { gap: 5px; }
  .filter-grid-4 .form-select { padding: 8px 4px; font-size: 11.5px; }
  .filter-grid-4 .input-group label { font-size: 10px; }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
}

/* ===== Form Controls (Apple iOS Style) ===== */
.form-input, .form-select {
  background: var(--input-bg);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
  /* <select>는 기본적으로 선택된 옵션 글자 길이에 맞춰 너비가 늘었다 줄었다 하므로,
     항상 그리드/부모 칸 너비 전체를 차지하도록 고정한다. */
  width: 100%;
  min-width: 0;
}

/* 라벨/드롭다운은 미니앱 전체에서 가운데 정렬 (자유 입력 텍스트칸·비고는 제외) */
.form-select, .form-select option {
  text-align: center;
  text-align-last: center;
}

.form-textarea {
  background: var(--input-bg);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: background 0.2s ease;
  width: 100%;
  resize: none;
  line-height: 1.5;
  font-family: inherit;
}

.form-select option {
  background-color: #ffffff;
  color: var(--text-main);
  font-size: 14px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  background: #e8e8ed;
}

/* ===== Stats Row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 18px;
}

.stat-pill {
  text-align: center;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.stat-pill .stat-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-pill .stat-value {
  font-size: 17px;
  font-weight: 800;
  display: block;
  margin-top: 2px;
}

.stat-pill.primary .stat-value { color: var(--accent-yellow-dark); }
.stat-pill.info .stat-value { color: #007aff; }
.stat-pill.success .stat-value { color: var(--accent-green); }

/* ===== Members Section ===== */
.members-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* "성도" 라벨 + 퀵네비를 필터카드와 같은 흰 카드 안에 담는다 (밖으로 노출되지 않게).
   스크롤할 때 카드(배경·테두리 포함) 전체가 같이 상단에 고정되어 성도 선택이 편하도록 sticky 처리 —
   퀵네비 요소만 sticky를 걸면 카드 배경은 스크롤되어 pill만 붕 뜨므로 반드시 카드 전체에 건다. */
.members-header-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.btn-secondary {
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-yellow-dark);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #e8e8ed;
}

.btn-primary {
  background: var(--accent-yellow);
  border: none;
  color: var(--accent-ink);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--accent-yellow-dark);
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px dashed #d1d5db;
}

/* ===== Bottom Action Bar (Fixed) ===== */
.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.12);
  padding: 10px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
}

.btn-save {
  width: 100%;
  max-width: 600px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  border-radius: var(--radius-md);
  min-height: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.spinner-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: btnSpin 0.75s linear infinite;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* ===== Apple-Style Member Card ===== */
.member-card {
  background: #ffffff;
  border: 0.5px solid #d1d1d6;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.member-card.new-member {
  border: 1.5px solid var(--accent-yellow);
  background: #fffdf7;
  animation: cardSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Add Member Card */
.add-member-card {
  background: transparent;
  border: 1.5px dashed #c7c7cc;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #aeaeb2;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 48px;
}

.add-member-card:hover {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow-dark);
  background: #fffbeb;
}

/* New Member Action Buttons (Large) */
.new-member-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.btn-new-save {
  flex: 2;
  background: var(--accent-yellow);
  color: var(--accent-ink);
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(255, 212, 0, 0.35);
}

.btn-new-save:hover {
  background: var(--accent-yellow-dark);
}

.btn-new-delete {
  flex: 1;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-new-delete:hover {
  background: #fca5a5;
  color: #991b1b;
}

/* Card Header */
.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.member-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.member-name {
  font-size: 15px;
  font-weight: 700;
  color: #1c1c1e;
  letter-spacing: -0.3px;
}

/* Status Pill */
.status-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  border: none;
  background: var(--input-bg);
}
.status-tag.정상 { background: #e8f8ef; color: #1b7a41; }
.status-tag.출결제외 { background: #fff4e6; color: #c2740c; }
.status-tag.근신 { background: #feecec; color: #c92a2a; }

/* 성도 카드 이름 오른쪽 "저번주 불러오기" 버튼 — 주차 토글(.week-toggle-btn)과 같은 톤.
   같은 줄의 상태 태그(.status-tag)와 높이를 맞춰서 버튼이 생겨도 카드 헤더가
   세로로 커지지 않게 한다(폰트·세로 패딩·line-height 동일). */
.btn-load-prev-week {
  flex-shrink: 0;
  align-self: center;
  background: var(--input-bg);
  border: none;
  border-radius: 999px;
  color: var(--accent-yellow-dark);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  padding: 2px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.btn-load-prev-week:active { opacity: 0.7; }
.btn-load-prev-week:disabled { opacity: 0.5; cursor: default; }

/* Grid Fields */
.grid-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 540px) {
  .grid-fields {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-fields .form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  /* 그리드 아이템은 기본적으로 내용물(전도 버튼의 긴 텍스트 등) 만큼 최소 너비를
     확보하려고 해서 칸 너비 전체가 밀려버린다. 0으로 풀어줘야 아래 ellipsis가 먹힌다. */
  min-width: 0;
}

.grid-fields label {
  font-size: 11px;
  color: #aeaeb2;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: center;
}

.grid-fields .form-select {
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.grid-fields .form-select:focus {
  background: #e8e8ed;
  box-shadow: none;
}

/* 결석 사유/미응시 사유/기도회 횟수 칸 — 트리거 항목이 맞지 않으면 자리는 그대로 두고 비활성화 */
.grid-fields .form-select:disabled,
.grid-fields .form-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 결석 사유/미응시 사유/기도회 횟수 — 활성화됐는데 값이 비어있으면(필수 미입력) 빨간 테두리 */
.form-select.field-invalid,
.form-input.field-invalid {
  border: 1.5px solid #dc2626;
  background: #fef2f2;
}

/* 기도회 / 기도회 횟수 — 너비를 반반씩 나눠 한 줄에 붙여둔다 */
.form-row-half {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.form-row-half .form-group {
  flex: 1 1 0;
  min-width: 0;
}

.field-prayer-count {
  text-align: center;
  /* 숫자 입력칸의 위아래 화살표(스피너)를 없애고 자유롭게 타이핑만 하도록 */
  -moz-appearance: textfield;
}
.field-prayer-count::-webkit-outer-spin-button,
.field-prayer-count::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Notes */
.form-group-notes {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-group-notes label {
  font-size: 11px;
  color: #aeaeb2;
  font-weight: 600;
  text-align: center;
}

.form-group-notes .form-textarea {
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-main);
}

.form-group-notes .form-textarea:focus {
  background: #e8e8ed;
}

/* ===== Evangelism Multi-Select Field & Modal ===== */
.btn-multi-trigger {
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  transition: background 0.2s;
}

.btn-multi-trigger:hover, .btn-multi-trigger:focus {
  background: #e8e8ed;
}

.btn-multi-trigger.has-value {
  color: var(--accent-yellow-dark);
  font-weight: 700;
}

/* Modal Backdrop */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Modal Card */
.modal-card {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalPopIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 0.5px solid #e5e5ea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1c1c1e;
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 24px;
  color: #8e8e93;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.chips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 400px) {
  .chips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.chip-btn {
  background: #f2f2f7;
  border: 1.5px solid transparent;
  border-radius: 12px;
  padding: 12px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1c1c1e;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.chip-btn:hover {
  background: #e8e8ed;
}

.chip-btn.active {
  background: #fffbeb;
  border-color: var(--accent-yellow);
  color: var(--accent-yellow-dark);
  box-shadow: 0 2px 6px rgba(255, 212, 0, 0.25);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 0.5px solid #e5e5ea;
  display: flex;
  justify-content: flex-end;
}

.btn-modal-confirm {
  width: 100%;
  background: var(--accent-yellow);
  color: var(--accent-ink);
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-modal-confirm:hover {
  background: var(--accent-yellow-dark);
}

/* 저장/저장 안 함/취소 3버튼 — 기본 modal-footer는 버튼 하나가 폭 100%를 채우는
   걸 전제로 해서, 여기선 버튼 3개가 나란히 균등폭으로 눕도록 따로 정의한다. */
.unsaved-footer {
  gap: 8px;
}
.btn-unsaved {
  flex: 1;
  border: none;
  border-radius: 12px;
  padding: 12px 6px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-unsaved:active {
  opacity: 0.7;
}
.btn-unsaved-cancel {
  background: var(--input-bg);
  color: var(--text-main);
}
.btn-unsaved-discard {
  background: var(--input-bg);
  color: var(--accent-rose);
}
.btn-unsaved-save {
  background: var(--accent-yellow);
  color: var(--accent-ink);
}

/* Save Success Confirm Card */
.save-success-card {
  padding: 24px 20px 20px 20px;
  text-align: center;
  align-items: center;
}

.save-success-icon {
  font-size: 40px;
  margin-bottom: 10px;
  line-height: 1;
}

.save-success-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: #1c1c1e;
  margin-bottom: 8px;
}

.save-success-card p {
  font-size: 14px;
  color: #636366;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Roster Navigation — 이제 .members-header-card 안에 들어있어 별도 배경/테두리 없이
   카드 배경 위에 바로 얹힌다 (카드 안에 또 카드가 겹치지 않도록). */
.members-quick-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* 스크롤 트랙 공간만큼 카드가 더 커 보이지 않도록 스크롤바 자체를 숨긴다
     (가로 스와이프/휠 스크롤 기능은 그대로 유지). */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.members-quick-nav::-webkit-scrollbar {
  display: none;
}
.members-quick-nav:empty {
  display: none;
}

.quick-nav-item {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  border-radius: 18px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #555558;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}
.quick-nav-item:hover {
  background: #fdf6e2;
  color: var(--accent-yellow-dark);
  border-color: var(--accent-yellow);
}

.highlight-flash {
  animation: highlightFlash 1.5s ease-out;
}

@keyframes highlightFlash {
  0% {
    background-color: #fffbeb;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 12px rgba(255, 212, 0, 0.5);
  }
  100% {
    background-color: #ffffff;
    border-color: #e5e5ea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  }
}

/* ===== 주간 현황 대시보드 (전체 톤을 미니앱과 같은 노란색 계열로 맞춘다) ===== */
.dash-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 20px;
}

/* 대시보드 전체 톤 — 요청대로 항목명 포함 모든 텍스트를 가운데 정렬한다. */
.dash-header, .dash-card, .dash-kpi-box, .dash-list-label {
  text-align: center;
}

.dash-header {
  background: linear-gradient(135deg, var(--accent-yellow) 0%, var(--accent-yellow-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  color: var(--accent-ink);
  margin-bottom: 12px;
}
/* 5개(총재적/출결재적/정식예배/비대면예배/결석)가 화면 폭이 좁아도 한 줄에 다 들어가도록
   줄바꿈 없이 flex:1로 균등폭 분배한다. */
.dash-header .counts { display: flex; justify-content: center; gap: 5px; flex-wrap: nowrap; }
.dash-header .counts .c { flex: 1; min-width: 0; background: rgba(255,255,255,.35); border-radius: 8px; padding: 6px 3px; font-size: 9px; }
.dash-header .counts .c b { font-size: 13px; display: block; }

.dash-section { margin-bottom: 16px; }

.dash-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.dash-card-title { font-size: 12.5px; font-weight: 700; color: var(--text-main); margin-bottom: 9px; }
.dash-card-sub { font-size: 10.5px; color: var(--text-muted); margin-bottom: 10px; }

/* 4주 추이 미니 라인그래프 */
.dash-trend-svg { display: block; width: 100%; height: auto; }
.dash-legend { display: flex; justify-content: center; gap: 12px; font-size: 10px; color: var(--text-muted); margin-top: 8px; flex-wrap: wrap; }
.dash-legend .li { display: flex; align-items: center; gap: 4px; }
.dash-legend .sw { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }

/* 비교 막대: 내 그룹 / 지역 평균 / 회 평균 — 막대(track)는 데이터 시각화라 그대로 두고,
   좌우 라벨/값 텍스트만 가운데 정렬한다. */
.dash-compare { display: flex; flex-direction: column; gap: 7px; }
.dash-compare-row { display: grid; grid-template-columns: 44px 1fr 46px; align-items: center; gap: 8px; }
.dash-compare-row .lbl { font-size: 10.5px; color: var(--text-muted); font-weight: 700; text-align: center; }
.dash-compare-row .track { background: var(--input-bg); border-radius: 6px; height: 12px; overflow: hidden; }
.dash-compare-row .fill { height: 100%; border-radius: 6px; }
/* 내 그룹/지역/회를 한눈에 구분할 수 있게 서로 뚜렷이 다른 색(검정/파랑/보라)을 쓴다 —
   추이 그래프(dashBuildTrendSVG)의 DASH_COLOR_MINE/REGION/DEPT와 반드시 같은 값을 쓴다. */
.dash-compare-row.mine .fill { background: #0a0a0a; }
.dash-compare-row.region .fill { background: #1d4ed8; }
.dash-compare-row.department .fill { background: #6d28d9; }
.dash-compare-row .val { font-size: 11.5px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

.dash-delta { font-size: 10.5px; font-weight: 700; margin-top: 8px; }
.dash-delta.up { color: #1e8e5a; }
.dash-delta.down { color: #d33636; }
.dash-delta.flat { color: var(--text-muted); }

/* 비교 막대 카드에 딸려오는 추가 명단(심방율 카드의 미심방자 등) — 위쪽에 구분선을 둬서
   "제목이 설명하는 비교 막대" 구역과 "덧붙은 명단" 구역이 뚜렷이 나뉘어 보이게 한다.
   이게 없으면 제목이 카드 전체(막대+명단)를 다 아우르는 것처럼 보여서 위쪽에 붕 떠보인다. */
.dash-card-extra { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--card-border); }

/* 요약 숫자 KPI 그리드 */
/* 내 그룹/지역/회 최대 3개뿐이라 항상 한 줄(3칸)로 고정 */
.dash-kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dash-kpi-box { background: var(--input-bg); border-radius: 10px; padding: 10px 12px; }
.dash-kpi-box .l { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; }
.dash-kpi-box .v { font-size: 17px; font-weight: 800; color: var(--text-main); }
.dash-kpi-box .cmp { font-size: 9.5px; color: var(--text-muted); margin-top: 3px; }

/* 명단 (일회성/연속/장기 결석자, 미응시자, 전도 미활동자) — 주간보고 탭의 성도 카드와
   같은 룩(둥근 흰 카드 + 은은한 그림자)으로, 접기/펼치기 없이 항상 펼쳐서 보여준다. */
.dash-list-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
}
.dash-list-label .count-badge {
  background: var(--accent-yellow-light);
  color: var(--accent-yellow-dark);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 800;
}
/* 한 줄에 한 명씩 쌓이면 명단이 길어질 때 너무 늘어지니, 칩처럼 여러 명이 한 줄에
   나란히 들어가고 다 차면 다음 줄로 넘어가게 한다. */
.dash-member-list { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dash-member-card {
  background: #ffffff;
  border: 0.5px solid #d1d1d6;
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.dash-member-card .name { font-size: 13px; font-weight: 700; color: #1c1c1e; letter-spacing: -0.3px; white-space: nowrap; }
.dash-member-card .tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  background: var(--input-bg);
  color: var(--text-muted);
  white-space: nowrap;
}
.dash-list-empty { padding: 8px 0 0; font-size: 11.5px; color: var(--text-muted); text-align: center; }

