/* ============================================================
   전도 분석 현황 (evangelism-status) — 2026-10-05 다시 만듦
   전도 대시보드(.evd)와 같은 톤: 옅은 회색 바탕 위 흰 카드, 남색 합계 줄, 라벨 위 필터줄.
   전도 대시보드처럼 흰 바탕 고정이다 — 앱이 다크 모드여도 이 화면은 밝다(앱 토큰을 빌리지 않고 .evs 안에서 색을 고정).
   수강신청서 = 파랑, 센터등록 = 초록. 클래스는 evs- 접두, 모든 규칙을 .evs 아래에 둔다.
   ============================================================ */

.evs {
  --evs-card: #ffffff;
  --evs-bg: #f3f5f9;
  --evs-line: #e3e7ef;
  --evs-line-strong: #cdd4e0;
  --evs-text: #1b2333;
  --evs-muted: #6b7482;
  --evs-faint: #b3bac6;
  --evs-track: #e9edf3;
  --evs-soft: #f5f7fb;
  --evs-navy: #1e2a5a;
  --evs-apply: #2563eb;
  --evs-apply-soft: #eaf1ff;
  --evs-apply-rgb: 37, 99, 235;
  --evs-center: #2e9a47;
  --evs-center-soft: #e8f6ec;
  --evs-center-rgb: 46, 154, 71;
  --evs-good: #15803d;
  --evs-ok: #1d4ed8;
  --evs-warn: #c2410c;
  --evs-low: #dc2626;
  --evs-gold: #d99a06;
  --evs-silver: #8a94a6;
  --evs-bronze: #b9703a;
  --evs-shadow: 0 1px 2px rgba(20, 35, 80, 0.05);
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.625rem;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--evs-text);
  color-scheme: light;
  background: var(--evs-bg);
  padding: 16px;
  border-radius: 12px;
  min-width: 0;
  word-break: keep-all;
  container: evs-root / inline-size;
  font-variant-numeric: tabular-nums;
}

.evs button { font: inherit; color: inherit; }
.evs .muted { color: var(--evs-faint); }

/* ---------- 필터줄 ---------- */
.evs .evs-filter {
  background: var(--evs-card);
  border: 1px solid var(--evs-line);
  border-radius: 12px;
  box-shadow: var(--evs-shadow);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.evs .evs-filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.evs .evs-year {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--evs-line-strong);
  border-radius: 8px;
  background-color: #fff;
  color: var(--evs-text);
  font-size: var(--fs-sm);
  font-weight: 600;
  width: auto;
  min-width: 0;
}
.evs .evs-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.evs .evs-chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--evs-line);
  border-radius: 999px;
  background: var(--evs-soft);
  color: var(--evs-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.evs .evs-chip:hover { border-color: var(--evs-line-strong); color: var(--evs-text); }
.evs .evs-chip.is-active { background: var(--evs-navy); border-color: var(--evs-navy); color: #fff; }
.evs .evs-scopes { padding-top: 10px; border-top: 1px dashed var(--evs-line); }

.evs .evs-scope-line { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 0 4px; }
.evs .evs-scope-line strong { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.01em; }
.evs .evs-scope-line span { color: var(--evs-muted); font-size: var(--fs-sm); }
.evs .evs-empty {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--evs-line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--evs-muted);
  font-size: var(--fs-sm);
}

/* ---------- 요약 카드 ---------- */
.evs .evs-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.evs .evs-kpi {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--evs-card);
  border: 1px solid var(--evs-line);
  border-radius: 12px;
  box-shadow: var(--evs-shadow);
  padding: 16px 16px 16px 18px;
  overflow: hidden;
  min-width: 0;
}
.evs .evs-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--evs-tone); }
.evs .evs-apply { --evs-tone: var(--evs-apply); --evs-tone-soft: var(--evs-apply-soft); --evs-tone-rgb: var(--evs-apply-rgb); }
.evs .evs-center { --evs-tone: var(--evs-center); --evs-tone-soft: var(--evs-center-soft); --evs-tone-rgb: var(--evs-center-rgb); }
.evs .evs-kpi-ring { position: relative; flex: 0 0 auto; width: 92px; height: 92px; display: grid; place-items: center; }
.evs .evs-kpi-ring b { position: absolute; font-size: var(--fs-md); font-weight: 800; letter-spacing: -0.02em; }
.evs .evs-donut { width: 92px; height: 92px; }
.evs .evs-donut circle { fill: none; stroke-width: 8; }
.evs .evs-donut .trk { stroke: var(--evs-track); }
.evs .evs-donut .arc { stroke: var(--evs-tone); stroke-linecap: round; }
.evs .evs-kpi-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.evs .evs-kpi-group {
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--evs-tone-soft);
  color: var(--evs-tone);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.evs .evs-kpi-body strong { font-size: var(--fs-lg); font-weight: 800; }
.evs .evs-kpi-basis { color: var(--evs-muted); font-size: var(--fs-sm); }
.evs .evs-kpi-basis b { color: var(--evs-text); font-weight: 700; }

/* ---------- 카드 공통 ---------- */
.evs .evs-card {
  background: var(--evs-card);
  border: 1px solid var(--evs-line);
  border-radius: 12px;
  box-shadow: var(--evs-shadow);
  padding: 16px;
  min-width: 0;
}
.evs .evs-card-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.evs .evs-card-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 800; }
.evs .evs-card-head p { margin: 2px 0 0; color: var(--evs-muted); font-size: var(--fs-sm); }
.evs .evs-card-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 0; }

.evs .evs-seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--evs-line-strong); border-radius: 9px; overflow: hidden; background: #fff; }
.evs .evs-seg-btn {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-right: 1px solid var(--evs-line);
  background: #fff;
  color: var(--evs-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.evs .evs-seg-btn:last-child { border-right: 0; }
.evs .evs-seg-btn:hover { background: var(--evs-soft); color: var(--evs-text); }
.evs .evs-seg-btn.is-active { background: var(--evs-tone, var(--evs-navy)); color: #fff; }

.evs .evs-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--evs-tone); margin-right: 6px; }

/* ---------- 막대 ---------- */
.evs .evs-bar { display: block; height: 10px; border-radius: 999px; background: var(--evs-track); overflow: hidden; min-width: 40px; }
.evs .evs-bar i { display: block; height: 100%; border-radius: 999px; background: var(--evs-tone); }
.evs .is-good > b, .evs .is-good .evs-rk-main b { color: var(--evs-good); }
.evs .is-warn > b, .evs .is-warn .evs-rk-main b { color: var(--evs-warn); }
.evs .is-low > b, .evs .is-low .evs-rk-main b { color: var(--evs-low); }

/* ---------- 회별 분석 ---------- */
.evs .evs-depts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.evs .evs-tone-green { --evs-dept: #2e9a47; }
.evs .evs-tone-orange { --evs-dept: #f08a17; }
.evs .evs-tone-purple { --evs-dept: #7a4bc4; }
.evs .evs-tone-teal { --evs-dept: #12969c; }
.evs .evs-dept { border: 1px solid var(--evs-line); border-radius: 10px; overflow: hidden; min-width: 0; }
.evs .evs-dept > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--evs-dept);
  color: #fff;
}
.evs .evs-dept h4 { margin: 0; font-size: var(--fs-md); font-weight: 800; }
.evs .evs-dept > header span { font-size: var(--fs-xs); opacity: 0.92; white-space: nowrap; }
.evs .evs-dept > header b { font-weight: 800; }
.evs .evs-dgroup { padding: 10px 12px 12px; }
.evs .evs-dgroup + .evs-dgroup { border-top: 1px solid var(--evs-line); }
.evs .evs-dgroup-head { display: flex; align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 700; margin-bottom: 8px; }
.evs .evs-dgroup-head em { margin-left: auto; font-style: normal; font-weight: 500; color: var(--evs-muted); font-size: var(--fs-xs); }
.evs .evs-mrow { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) 4.2em; align-items: center; column-gap: 8px; row-gap: 0; padding: 3px 0; }
.evs .evs-mrow-label { color: var(--evs-muted); font-size: var(--fs-xs); }
.evs .evs-mrow b { text-align: right; font-size: var(--fs-md); font-weight: 800; }
.evs .evs-mrow small { grid-column: 2 / 4; text-align: right; color: var(--evs-faint); font-size: var(--fs-xs); line-height: 1.2; }

/* ---------- 표 공통 ---------- */
.evs .evs-table-wrap { overflow-x: auto; border: 1px solid var(--evs-line); border-radius: 10px; }
.evs .evs-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.evs .evs-table th, .evs .evs-table td { padding: 9px 10px; border-bottom: 1px solid var(--evs-line); text-align: center; vertical-align: middle; white-space: nowrap; }
.evs .evs-table thead th { background: var(--evs-soft); color: var(--evs-muted); font-size: var(--fs-xs); font-weight: 700; line-height: 1.25; }
.evs .evs-table tbody tr:last-child td { border-bottom: 0; }
.evs .evs-table .nm { text-align: left; font-weight: 700; position: sticky; left: 0; background: #fff; z-index: 1; }
.evs .evs-table thead .nm { background: var(--evs-soft); }
.evs .evs-table .nm button { border: 0; background: none; padding: 0; font-weight: 700; cursor: pointer; text-align: left; }
.evs .evs-table .nm button:hover { color: var(--evs-apply); text-decoration: underline; }
.evs .evs-table tr.is-current td { background: #fffbea; }
.evs .evs-table tr.is-current .nm { box-shadow: inset 3px 0 0 var(--evs-gold); }
.evs .evs-table tfoot td { background: var(--evs-navy); color: #fff; font-weight: 700; border-bottom: 0; }
.evs .evs-table tfoot .nm { background: var(--evs-navy); }
.evs .evs-table tfoot small { color: rgba(255, 255, 255, 0.72); }
.evs .evs-table td b { font-weight: 800; }
.evs .evs-table td small { display: block; color: var(--evs-faint); font-size: var(--fs-xs); line-height: 1.2; }

/* ---------- 순위 ---------- */
.evs .evs-rank {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--evs-soft);
  color: var(--evs-muted);
  font-size: var(--fs-sm);
  font-weight: 800;
}
.evs .evs-rank.is-top { color: #fff; }
.evs .evs-rank.is-top1 { background: var(--evs-gold); }
.evs .evs-rank.is-top2 { background: var(--evs-silver); }
.evs .evs-rank.is-top3 { background: var(--evs-bronze); }
.evs .evs-rank.is-none { background: none; color: var(--evs-faint); }
.evs .evs-ranking .rk { width: 52px; }
.evs .evs-ranking th.mt { padding: 0; }
.evs .evs-ranking th.mt button { width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--evs-muted); font-size: var(--fs-xs); font-weight: 700; line-height: 1.25; cursor: pointer; }
.evs .evs-ranking th.mt button:hover { color: var(--evs-tone); }
.evs .evs-ranking th.mt.is-sel { box-shadow: inset 0 -3px 0 var(--evs-tone); }
.evs .evs-ranking th.mt.is-sel button { color: var(--evs-tone); }
.evs .evs-ranking td.mt.is-sel { background: #fafbfe; min-width: 220px; }
.evs .evs-ranking tr.is-current td.mt.is-sel { background: #fff6d6; }
.evs .evs-ranking tfoot td.mt.is-sel { background: #2a3a78; }
.evs .evs-rk-main { display: grid; grid-template-columns: minmax(60px, 1fr) 4.4em; align-items: center; gap: 10px; }
.evs .evs-rk-main b { text-align: right; font-size: var(--fs-md); }
.evs .evs-ranking td.mt.is-sel small { text-align: right; }
.evs .evs-ranking tfoot td.mt.is-sel small { text-align: center; }
.evs .evs-ranking tbody td:nth-child(3) .evs-bar, .evs .evs-ranking tbody td:nth-child(4) .evs-bar { --evs-tone: var(--evs-apply); }
.evs .evs-ranking tbody td:nth-child(5) .evs-bar, .evs .evs-ranking tbody td:nth-child(6) .evs-bar { --evs-tone: var(--evs-center); }
.evs .evs-ranking tr.is-empty .nm button { color: var(--evs-muted); font-weight: 600; }

.evs .evs-ranklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.evs .evs-ranklist li { display: grid; grid-template-columns: 28px 5em minmax(0, 1fr) 4.4em 7em; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--evs-line); border-radius: 10px; }
.evs .evs-ranklist .nm { font-weight: 700; }
.evs .evs-ranklist b { text-align: right; font-weight: 800; }
.evs .evs-ranklist small { text-align: right; color: var(--evs-faint); font-size: var(--fs-xs); }

/* ---------- 교회 × 회 ---------- */
.evs .evs-matrix thead th[class^="evs-tone-"] { color: var(--evs-dept); box-shadow: inset 0 -3px 0 var(--evs-dept); }
.evs .evs-matrix td.hc { background: rgba(var(--evs-tone-rgb), calc(var(--evs-heat, 0) * 0.42)); }
.evs .evs-matrix tr.is-current td.hc { background: rgba(var(--evs-tone-rgb), calc(var(--evs-heat, 0) * 0.42)); }
.evs .evs-matrix td.hc.muted { background: none; }
.evs .evs-matrix td.hc small { color: var(--evs-muted); }
.evs .evs-matrix td.hc.is-first b::before { content: "★ "; color: var(--evs-gold); font-size: 0.85em; }
.evs .evs-matrix .tot { border-left: 2px solid var(--evs-line-strong); }
.evs .evs-matrix tr.is-current td.hc { box-shadow: inset 0 2px 0 var(--evs-gold), inset 0 -2px 0 var(--evs-gold); }
.evs .evs-matrix tfoot td.hc { background: var(--evs-navy); }

/* ---------- 월별 추이 ---------- */
.evs .evs-trends { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.evs .evs-trend { border: 1px solid var(--evs-line); border-radius: 10px; padding: 12px; min-width: 0; }
.evs .evs-trend h4 { margin: 0 0 8px; font-size: var(--fs-sm); font-weight: 700; }
.evs .evs-trend-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; align-items: end; }
.evs .evs-tbar { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 2px 0; border: 0; border-radius: 6px; background: none; cursor: pointer; min-width: 0; }
.evs .evs-tbar:hover { background: var(--evs-soft); }
.evs .evs-tbar .v { height: 1.2em; font-size: 0.6875rem; font-weight: 700; color: var(--evs-muted); text-align: center; overflow: hidden; }
.evs .evs-tbar .col { height: 84px; display: flex; align-items: flex-end; border-radius: 4px; background: var(--evs-soft); overflow: hidden; }
.evs .evs-tbar .col i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: rgba(var(--evs-tone-rgb), 0.45); }
.evs .evs-tbar .m { font-size: var(--fs-xs); color: var(--evs-muted); text-align: center; }
.evs .evs-tbar.is-current .col i { background: var(--evs-tone); }
.evs .evs-tbar.is-current .m, .evs .evs-tbar.is-current .v { color: var(--evs-tone); font-weight: 800; }

/* ---------- 좁은 폭 ---------- */
@container evs-root (max-width: 1080px) {
  .evs .evs-kpis, .evs .evs-depts, .evs .evs-trends { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evs .evs-card-tools { align-items: flex-start; }
}
@container evs-root (max-width: 620px) {
  .evs .evs-kpis, .evs .evs-depts, .evs .evs-trends { grid-template-columns: minmax(0, 1fr); }
  .evs .evs-kpi-ring, .evs .evs-donut { width: 76px; height: 76px; }
  .evs .evs-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .evs .evs-seg { max-width: 100%; }
  .evs .evs-seg-btn { padding: 0 9px; }
  /* 좁은 폭의 순위표는 고른 지표 한 칸만 — 나머지 지표는 위 단추로 바꿔 본다. */
  .evs .evs-ranking .mt:not(.is-sel) { display: none; }
  .evs .evs-ranking td.mt.is-sel { min-width: 0; }
  .evs .evs-ranking .rk { width: 40px; }
  .evs .evs-table th, .evs .evs-table td { padding: 8px 5px; }
  .evs .evs-matrix td.hc b { font-size: var(--fs-xs); }
  .evs .evs-ranklist li { grid-template-columns: 28px 4.4em minmax(0, 1fr) 4.2em; }
  .evs .evs-ranklist small { grid-column: 2 / 5; }
}
@media (max-width: 640px) {
  .evs { padding: 10px; border-radius: 8px; }
  .evs .evs-card { padding: 12px; }
}

@media print {
  .evs { background: #fff; padding: 0; }
  .evs .evs-filter { display: none; }
}

/* 전도 대시보드 「교회 순위」 탭 안에 들어갈 때(2026-10-05) — 대시보드 폭을 그대로 쓴다(가운데 정렬 여백이 폭을 0 으로 만든다). */
.evd > .evs { width: 100%; max-width: none; margin: 0; }
