/* ════════════════════════════════════════
   각종 규정 — 화면 스타일 (public/css/rules.css)

   · 열람 화면(rl-) : 왼쪽 목록 / 오른쪽 상세 2단(2026-09-13 좌우 바꿈). 위쪽(검색)은 고정, 목록·본문만 스크롤.
     ★상세칸도 같은 4단 규칙 — .rl-detail(flex column, overflow:hidden) / .rl-d-head(flex-shrink:0) /
     .rl-content(flex:1; min-height:0; overflow-y:auto) → 제목·단추줄은 고정되고 본문만 내려간다(2026-09-14).
     좁은 화면(900px 미만)에서는 목록이 위로 오고 아래에 본문이 놓인다.
   · 관리 화면(ra-) : 현황 카드 · 업로드 상자 · 미리보기 표.
   색은 교단 CI(Denim #2F557F · Campfire #E36520 · Ming #3E8391) 계열로 맞춘다.
════════════════════════════════════════ */

/* ── 열람 화면 ── */
#view-rules.active { display: flex !important; flex-direction: column; height: calc(100vh - 108px); overflow: hidden; }
.rl-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.rl-top { flex-shrink: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-bottom: 12px; }
.rl-search { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 260px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; }
.rl-search i { color: var(--text-sub); }
.rl-search input { flex: 1; border: none; outline: none; font-size: 13.5px; font-family: inherit; min-width: 120px; }
.rl-abol { font-size: 12.5px; color: var(--text-sub); display: flex; align-items: center; gap: 5px; white-space: nowrap; }

.rl-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 12px; }
.rl-detail { min-height: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; }   /* 머리(제목·단추)는 고정, 본문만 스크롤 */
.rl-list { min-height: 0; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.rl-list-head { position: sticky; top: 0; z-index: 2; background: #eef2f7; border-bottom: 1px solid var(--border);
  padding: 9px 12px; font-size: 12.5px; color: #2f557f; display: flex; align-items: center; gap: 6px; }
.rl-list-head .rl-book-btn { margin-left: auto; white-space: nowrap; }
.rl-row { padding: 9px 12px; border-bottom: 1px solid var(--border-light); cursor: pointer; }
.rl-row:hover { background: #f6f9fc; }
.rl-row.on { background: #e7eef7; box-shadow: inset 3px 0 0 #2f557f; }

/* 「개정 표시 숨기기」를 켠 상태 — 지금 무엇을 보고 있는지 단추에서 바로 알게 한다 */
#rl-clean-btn.on { background: #e7eef7; border-color: #2f557f; color: #2f557f; font-weight: 700; }
.rl-row.abol .rl-row-t { color: #8b95a1; }
.rl-row-t { font-size: 13px; line-height: 1.5; }
.rl-no { color: #2f557f; font-weight: 700; margin-right: 4px; }
.rl-ref, .rl-snip { font-size: 11.5px; color: var(--text-sub); margin-top: 3px; line-height: 1.5; }
.rl-cnt { display: inline-block; min-width: 18px; text-align: center; background: #2f557f; color: #fff;
  border-radius: 9px; font-size: 11px; padding: 0 5px; margin-left: 4px; }
.rl-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px;
  background: #e7f0e7; color: #3b6b2f; margin-left: 4px; white-space: nowrap; }
.rl-badge-abol { background: #f1f1f1; color: #6b7280; }

.rl-d-head { flex-shrink: 0; border-bottom: 1px solid var(--border-light); padding: 18px 22px 10px; background: #fff; border-radius: 12px 12px 0 0; }
.rl-d-title { font-size: 19px; font-weight: 800; color: #1f2937; line-height: 1.4; }
.rl-d-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 12.5px; color: var(--text-sub); }
.rl-d-meta b { color: #2f557f; font-weight: 700; margin-right: 4px; }
.rl-d-tools { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.rl-hitnav { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #2f557f; margin-right: 6px; }
.rl-abol-note { margin-top: 10px; background: #f4f4f5; color: #52525b; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; }
.rl-detail > .rl-src-note { flex-shrink: 0; margin: 10px 22px 0; }   /* 현행본 안내띠 — 머리 아래 고정 */
.rl-src-note { margin-top: 10px; background: #fdf3ea; color: #9a4c13; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; }

.rl-content { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 22px 18px; font-size: 13.5px; line-height: 1.85; color: #1f2937; }
.rl-content p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.rl-content table { border-collapse: collapse; margin: 8px 0; }
.rl-content td, .rl-content th { border: 1px solid #c7ced6; padding: 4px 8px; vertical-align: middle; }
.rl-content mark.rl-hit { background: #fff3a3; padding: 0 1px; }
.rl-content mark.rl-hit.cur { background: #ffc400; }

.rl-detail > .rl-empty { padding: 28px 22px; }
.rl-empty { padding: 28px 10px; text-align: center; color: var(--text-sub); font-size: 13px; line-height: 1.7; }
.rl-err { color: #c0392b; }
.rl-rev-wrap { overflow-x: auto; }
.rl-rev { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rl-rev th, .rl-rev td { border: 1px solid var(--border-light); padding: 6px 8px; text-align: left; white-space: nowrap; }
.rl-rev th { background: #eef2f7; color: #2f557f; }

@media (max-width: 900px) {
  #view-rules.active { height: auto; overflow: visible; }
  .rl-body { grid-template-columns: 1fr; }
  .rl-list { max-height: 40vh; }      /* 목록이 먼저 그려져 있어 좁은 화면에서도 자연히 위로 온다 */
  .rl-detail { display: block; overflow: visible; }
  .rl-content { overflow: visible; min-height: auto; }
}

/* ── 결의번호 링크와 결의 내용 모달(rules-refs.js) ── */
/* 결의번호는 본문 글씨(#1f2937)와 확실히 구분되게 — 교단 CI Campfire 계열의 진한 색 + 옅은 바탕.
   ★밝은 #e36520 을 그대로 글자에 쓰면 흰 바탕 대비가 모자란다(3.2:1) → 진한 #b4530f 를 쓴다. */
.rl-reflink { color: #b4530f; background: #fdf3ea; border-bottom: 1px solid #e36520; border-radius: 4px;
  padding: 0 3px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.rl-reflink:hover { color: #fff; background: #e36520; border-bottom-color: #b4530f; }
.rf-note { font-size: 12.5px; color: var(--text-sub); background: #eef2f7; border-radius: 8px; padding: 10px 12px; line-height: 1.7; }
.rf-warn { background: #fdf3ea; color: #9a4c13; }
.rf-card { border: 1px solid var(--border-light); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.rf-line { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--text-sub); }
.rf-no { background: #2f557f; color: #fff; border-radius: 8px; padding: 1px 8px; font-weight: 700; }
.rf-cm, .rf-dep { background: #eef2f7; color: #2f557f; border-radius: 8px; padding: 1px 8px; }
.rf-title { font-size: 14.5px; font-weight: 700; color: #1f2937; margin: 8px 0 6px; line-height: 1.5; }
.rf-content { font-size: 13px; line-height: 1.8; color: #1f2937; white-space: pre-wrap; word-break: break-word; }
/* ★한글(HWPX) 의사록 본문 — 표가 든 안건은 글자 그대로 줄바꿈(pre-wrap)·글자 단위 끊기를 풀어야 표가 산다.
   모달이 좁아 표가 눌리므로 표는 제 너비를 갖게 두고 가로 스크롤로 본다(2026-09-14). */
.rf-content.mn-rich { white-space: normal; word-break: normal; overflow-x: auto; }
.rf-content.mn-rich table { max-width: none; }
.rf-content.mn-rich td, .rf-content.mn-rich th { word-break: keep-all; }
.rf-foot { margin-top: 10px; font-size: 11.5px; color: var(--text-sub); }

/* ── 등록·고치기 모달(rules-edit.js) ── */
.rl-danger { color: #c0392b; border-color: #e8b9b3; }
.rl-danger:hover { background: #fbeaea; }
.rl-edit-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rl-edit-title { font-size: 16px; font-weight: 800; flex: 1; line-height: 1.4; }
.rl-edit-body { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; }
.rl-edit-fields { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rl-edit-fields label, .rl-edit-reason { font-size: 12px; color: var(--text-sub); display: flex; flex-direction: column; gap: 4px; }
.rl-edit-fields label.wide { flex: 1; min-width: 240px; }
.rl-edit-fields input, .rl-edit-reason input { border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 9px; font-size: 13.5px; font-family: inherit; }
.rl-edit-reason { margin-top: 10px; }
.rl-edit-reason span { color: #9aa3ad; }
.rl-edit-area { min-height: 320px; max-height: 52vh; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 0 0 8px 8px; padding: 14px 16px; font-size: 13.5px; line-height: 1.85; background: #fff; outline: none; }
.rl-edit-area p { margin: 0; }
.rl-edit-area table { border-collapse: collapse; }
.rl-edit-area td, .rl-edit-area th { border: 1px solid #c7ced6; padding: 4px 8px; }
.rl-edit-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.rl-edit-note { flex: 1; font-size: 12px; color: var(--text-sub); }
.rl-ask { text-align: left; }
.rl-ask p { font-size: 13.5px; line-height: 1.7; margin: 0 0 10px; }
.rl-ask label { font-size: 12px; color: var(--text-sub); display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.rl-ask input { border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; font-size: 13.5px; font-family: inherit; }

/* ── 신·구 대비표(rules-diff.js) ── */
.rd-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.rd-top label { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 5px; }
.rd-top select { border: 1px solid var(--border); border-radius: 8px; padding: 5px 7px; font-size: 12.5px; font-family: inherit; }
.rd-chk { white-space: nowrap; }
.rd-sum { flex: 1; font-size: 12.5px; color: #2f557f; font-weight: 700; }
.rd-wrap { overflow: auto; max-height: 62vh; border: 1px solid var(--border-light); border-radius: 10px; }
.rd-table { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.75; }
.rd-table th, .rd-table td { border-bottom: 1px solid var(--border-light); border-right: 1px solid var(--border-light);
  padding: 7px 9px; text-align: left; vertical-align: top; word-break: break-word; }
.rd-table thead th { position: sticky; top: 0; z-index: 2; background: #e7eef7; color: #2f557f; }
.rd-table th.rd-t, .rd-table td.rd-t { width: 58px; text-align: center; white-space: nowrap; color: var(--text-sub); }
.rd-table td:last-child, .rd-table th:last-child { border-right: none; }
.rd-table tr.rd-head-row { background: #f7f9fc; }
.rd-table tr.rd-added td { background: #f2f7f2; }
.rd-table tr.rd-removed td { background: #fbf5f2; }
.rd-del { color: #9a4c13; text-decoration: line-through; }
.rd-add { color: #2f557f; text-decoration: underline; font-weight: 700; }
.rd-note { margin-top: 8px; font-size: 12px; color: var(--text-sub); }

/* ── 관리 화면 ── */
.ra-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ra-title { font-size: 20px; font-weight: 800; flex: 1; }
.ra-title small { font-size: 12.5px; font-weight: 500; color: var(--text-sub); margin-left: 6px; }
.ra-cards { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.ra-card { min-width: 110px; background: #eef2f7; border-radius: 12px; padding: 12px 16px; }
.ra-card.gray { background: #f4f4f5; }
.ra-card.ghost { background: #fff; border: 1px solid var(--border); }
.ra-card-n { font-size: 22px; font-weight: 800; color: #2f557f; }
.ra-card-l { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

.ra-sec { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-top: 14px; }
.ra-sec-h { font-size: 14.5px; font-weight: 800; color: #2f557f; margin-bottom: 10px; }
.ra-guide { font-size: 12.5px; color: var(--text-sub); line-height: 1.8; margin-bottom: 12px; }
.ra-drop i { color: #c0392b; }
.ra-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.ra-fileinfo { flex: 1; font-size: 12px; color: var(--text-sub); }
.ra-result { margin-top: 12px; }
.ra-err { background: #fbeaea; color: #c0392b; border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.ra-sum { font-size: 13px; color: #1f2937; background: #eef2f7; border-radius: 10px; padding: 10px 14px; }
.ra-miss { color: #9a4c13; }
.ra-warnbox { margin-top: 8px; background: #fdf3ea; color: #9a4c13; border-radius: 10px; padding: 10px 14px; font-size: 12.5px; line-height: 1.7; }

.ra-table-wrap { margin-top: 10px; max-height: 52vh; overflow: auto; border: 1px solid var(--border-light); border-radius: 10px; }
.ra-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ra-table th, .ra-table td { border-bottom: 1px solid var(--border-light); padding: 6px 8px; text-align: left; }
.ra-table thead th { position: sticky; top: 0; z-index: 2; background: #d4dde9; color: #24334a; white-space: nowrap; }
.ra-table .ra-c { text-align: center; white-space: nowrap; }
.ra-table .ra-file { word-break: break-all; }
.ra-prev input[type="text"] { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-size: 12.5px; font-family: inherit; }
.ra-prev .ra-r { max-width: 170px; }
.ra-warn { color: #9a4c13; font-size: 11.5px; line-height: 1.6; }
.ra-b { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; white-space: nowrap; }
.ra-b-new { background: #e7f0e7; color: #3b6b2f; }
.ra-b-upd { background: #fdf3ea; color: #9a4c13; }
.ra-b-same { background: #f1f1f1; color: #6b7280; }

.ra-commit { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.ra-fields-note { flex-basis: 100%; font-size: 12px; color: var(--text-sub); line-height: 1.6; margin-bottom: 2px; }
.ra-fields-note b { color: #2f557f; }
.ra-commit-go { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ra-not-saved { font-size: 12px; color: #9a4c13; background: #fdf3ea; border-radius: 8px; padding: 6px 10px; line-height: 1.6; }
.ra-soon { color: #9a4c13; }
.ra-fields { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.ra-fields label { font-size: 12px; color: var(--text-sub); display: flex; flex-direction: column; gap: 4px; }
.ra-fields label.wide { flex: 1; min-width: 200px; }
.ra-fields input { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: inherit; }
.ra-batches { overflow-x: auto; }

/* ── 재정규정(2026-10-04) — 지금 판 표시·연도 대비표(finance-view.js) ── */
.rl-year { font-size: 12.5px; color: #2f557f; background: #eef3f9; border-radius: 9px; padding: 3px 10px; white-space: nowrap; }
.rl-year:empty { display: none; }
.rl-year-none { color: var(--text-sub); }
.rlf-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.rlf-pick select { border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 13px; font-family: inherit; margin-left: 4px; }
.rlf-sum { background: #f7f9fc; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.rlf-h { font-size: 14px; color: #2f557f; margin: 16px 0 8px; }
.rlf-num { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.6; }
.rlf-num th, .rlf-num td { border: 1px solid var(--border-light); padding: 5px 8px; vertical-align: top; }
.rlf-num thead th { background: #e7eef7; color: #2f557f; white-space: nowrap; }
.rlf-ctx { color: var(--text-sub); word-break: break-all; }
.rlf-old { color: #9a4c13; text-decoration: line-through; white-space: nowrap; }
.rlf-new { color: #2f557f; font-weight: 600; white-space: nowrap; }
.rlf-item { border: 1px solid var(--border-light); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.rlf-item-h { background: #f7f9fc; padding: 7px 12px; font-size: 13.5px; font-weight: 600; }
.rlf-st { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; margin-right: 4px; font-weight: 500; }
.rlf-st-ch { background: #fdf3ea; color: #9a4c13; }
.rlf-st-add { background: #e7f0e7; color: #3b6b2f; }
.rlf-st-del { background: #fbeaea; color: #a33; }
.rlf-old-title { color: var(--text-sub); font-weight: 400; }
.rlf-only-title { padding: 8px 12px; font-size: 12.5px; color: var(--text-sub); }
.rlf-foot { font-size: 12px; color: var(--text-sub); margin-top: 8px; }

/* ── 재정규정 관리(finance-admin.js) — fna- 접두어(Font Awesome의 fa- 이름과 겹치지 않게) ── */
.fna-wrap { max-width: 1100px; }
.fna-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fna-top h3 { margin: 0; font-size: 17px; color: #2f557f; }
.fna-sec { background: var(--card-bg, #fff); border: 1px solid var(--border-light); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.fna-sec h4 { margin: 0 0 8px; font-size: 14.5px; }
.fna-sec h4 small { color: var(--text-sub); font-weight: 400; margin-left: 4px; }
.fna-help { font-size: 12.5px; color: var(--text-sub); line-height: 1.7; margin: 0 0 10px; }
.fna-up { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fna-prev { margin-top: 12px; }
.fna-file { font-size: 13px; margin-bottom: 8px; }
.fna-mode { background: #eef3f9; color: #2f557f; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; line-height: 1.6; margin-bottom: 8px; }
.fna-mode-arc { background: #f4f4f5; color: #52525b; }
.fna-warn { background: #fdf3ea; color: #9a4c13; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; line-height: 1.6; margin-bottom: 8px; }
.fna-warn ul { margin: 4px 0 0 18px; padding: 0; }
.fna-notes { font-size: 12px; color: var(--text-sub); margin: 0 0 8px 18px; padding: 0; line-height: 1.6; }
.fna-items { margin-top: 6px; }
.fna-iw { font-size: 11.5px; color: #9a4c13; }
.fna-a { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px; white-space: nowrap; }
.fna-a-new { background: #e7f0e7; color: #3b6b2f; }
.fna-a-up { background: #fdf3ea; color: #9a4c13; }
.fna-a-same { background: #f1f1f1; color: #6b7280; }
.fna-commit { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.fna-commit label { font-size: 12px; color: var(--text-sub); display: flex; flex-direction: column; gap: 4px; }
.fna-commit label.wide { flex: 1; min-width: 220px; }
.fna-commit label.rd-chk { flex-direction: row; align-items: center; }
.fna-commit input[type="text"], .fna-commit input[type="number"], .fna-commit input[type="date"] { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: inherit; }
