/* 내무부 대시보드(2026-11-01). 색은 base.css 토큰만 쓴다 — 다크모드는 토큰 재정의로 자동으로 맞는다. */
.idash-view {
  min-width: 0;
}

.idash-control {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.idash-control select {
  min-height: var(--ctl-h-sm);
}

.idash-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.idash-segment {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.idash-segment button {
  min-height: var(--ctl-h-sm);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 0;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

.idash-segment button.active {
  background: var(--brand-fill);
  color: #fff;
}

.idash-subnav {
  margin-bottom: var(--space-3);
}

.idash-kpis {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: var(--space-2);
}

.idash-scope-note {
  margin: 0 0 var(--space-3);
}

.idash-todo-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.idash-todo-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.idash-table th:not(:first-child),
.idash-table td:not(:first-child) {
  text-align: center;
}

.idash-table td {
  vertical-align: middle;
}

/* 좁은 화면: 첫 칸(교회·부서·입교 기간)은 한 줄로 두고, 넓은 표는 표 상자 안에서만 옆으로 민다. */
.idash-table th:first-child,
.idash-table td:first-child {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .idash-table {
    min-width: 640px;
  }

  /* 모바일 본문 좌우 여백은 12px 인데 base 의 탭 줄은 -16px 로 뻗어 390px 화면이 394px 로 가로 스크롤됐다. */
  .idash-view .dashboard-tabs {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  /* 보고서 표는 640px 최소폭이라 좁은 화면에서는 블록 안에서만 옆으로 민다(인쇄에는 적용 안 됨). */
  .idash-report-block {
    max-width: 100%;
    overflow-x: auto;
  }
}

/* 순수마트 규칙색: ▲ 증가 빨강 · ▼ 감소 파랑(작은 숫자 표시에만). */
.idash-delta {
  font-weight: 800;
  white-space: nowrap;
}

.idash-delta.idash-up {
  color: var(--bad);
}

.idash-delta.idash-down {
  color: var(--blue);
}

.idash-cause {
  display: grid;
  gap: 2px;
  font-size: 13px;
  font-weight: 700;
}

.idash-cause .hint {
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.idash-view .echart {
  min-height: calc(var(--ctl-h) * 8);
  margin-top: var(--space-2);
}

.idash-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
}

.idash-form .field {
  min-width: calc(var(--ctl-h) * 4);
}

.idash-row-actions {
  white-space: nowrap;
}

/* 순위 5단계(상·중상·중·중하·하) — 순수마트 규칙색을 토큰으로. 작은 배지에만 쓴다. */
.idash-tier,
.idash-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 22px;
  padding: 2px var(--space-2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--soft);
  color: var(--muted);
}

.idash-grade {
  border: 1px solid var(--line);
  color: var(--ink);
}

.idash-tier.t1 { background: var(--blue-soft); color: var(--blue); }
.idash-tier.t2 { background: var(--good-soft); color: var(--good); }
.idash-tier.t3 { background: var(--warn-soft); color: var(--warn); }
.idash-tier.t4 { background: var(--warn-soft); color: var(--bad); }
.idash-tier.t5 { background: var(--bad-soft); color: var(--bad); }

.idash-table tr.idash-ours td {
  background: var(--brand-soft);
  font-weight: 800;
}

.idash-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.idash-more:empty {
  display: none;
}

.idash-details > summary {
  cursor: pointer;
  font-weight: 800;
}

/* 점검 항목·하늘의 흐름·지시 */
.idash-check-list,
.idash-log,
.idash-edit-list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.idash-check {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--ctl-radius);
  background: var(--panel);
}

.idash-check-head,
.idash-message-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.idash-check-text {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.badge.idash-strong {
  color: var(--bad);
}

.idash-message,
.idash-order {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}

.idash-message h4,
.idash-orders h4 {
  margin: 0;
}

.idash-message p,
.idash-order p {
  margin: 0;
  line-height: 1.7;
}

.idash-order blockquote {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--brand);
  background: var(--soft);
  border-radius: 0 var(--ctl-radius) var(--ctl-radius) 0;
}

.idash-orders {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.idash-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin-bottom: var(--space-3);
}

.idash-edit-list {
  margin-top: var(--space-3);
}

.idash-edit-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line);
}

.idash-form .idash-field-wide {
  flex-basis: 100%;
}

.idash-form textarea {
  width: 100%;
}

/* 내 화면 — 바로 보기 타일·「이번 주 한 장」 카드 */
.idash-dept-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.idash-dept-head h3 {
  margin: 0;
  font-size: 20px;
}

.idash-dept-head {
  margin-bottom: var(--space-4);
}

.idash-section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
  margin: var(--space-4) 0 var(--space-2);
  font-size: 16px;
}

.idash-section-title .hint {
  font-size: 12px;
  font-weight: 400;
}

.idash-kpis-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 지표 타일: 왼쪽 띠 색으로 종류를 구분한다(토큰만). 눌리는 타일은 오른쪽 위에 ›를 둔다. */
.idash-tile {
  position: relative;
  box-shadow: inset 4px 0 0 var(--line);
}

.idash-tile .value {
  font-size: 32px;
}

.idash-tile.idash-tone-f { box-shadow: inset 4px 0 0 var(--brand); }
.idash-tile.idash-tone-n { box-shadow: inset 4px 0 0 var(--blue); }
.idash-tile.idash-tone-warn { box-shadow: inset 4px 0 0 var(--warn); }
.idash-tile.idash-tone-bad { box-shadow: inset 4px 0 0 var(--bad); }

.idash-tile-link {
  cursor: pointer;
}

.idash-tile-link::after {
  content: "›";
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.idash-tile-link:hover {
  border-color: var(--brand);
}

.idash-tile-link:hover::after {
  color: var(--brand);
}

.idash-tile-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.idash-sheets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.idash-sheet {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--ctl-radius);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.idash-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
}

.idash-sheet-head strong {
  font-size: 15px;
}

.idash-sheet-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
}

.idash-sheet-hero strong {
  font-size: 34px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.idash-sheet-hero span {
  color: var(--muted);
  font-size: 13px;
}

.idash-tone-f .idash-sheet-hero strong { color: var(--brand); }
.idash-tone-n .idash-sheet-hero strong { color: var(--blue); }

.idash-sheet dl {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.idash-sheet dl div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: var(--space-2);
}

.idash-sheet dt {
  justify-self: start;
  padding: 1px var(--space-2);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.idash-sheet dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.idash-sheet dd.idash-empty,
.idash-empty {
  color: var(--muted);
}

.idash-sheet-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.idash-sheet-pair > div {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: var(--space-3);
  border-radius: var(--ctl-radius);
  background: var(--soft);
}

.idash-sheet-pair span,
.idash-sheet-pair small {
  color: var(--muted);
  font-size: 12px;
}

.idash-sheet-pair span {
  font-weight: 800;
}

.idash-sheet-pair strong {
  font-size: 26px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.idash-num-table td,
.idash-num-table th {
  font-variant-numeric: tabular-nums;
}

.idash-num-table tbody tr:hover td {
  background: var(--soft);
}

@media (max-width: 760px) {
  .idash-kpis-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .idash-tile .value {
    font-size: 28px;
  }
}

.idash-tile[disabled] {
  cursor: default;
}

/* 회의 준비 보고서 */
.idash-report {
  display: grid;
  gap: var(--space-4);
}

.idash-report-head h3 {
  margin: 0;
}

.idash-report-block h4 {
  margin: 0 0 var(--space-2);
}

.idash-report-list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding-left: var(--space-4);
  line-height: 1.6;
}

/* 「인쇄 / PDF」를 누른 동안만 보고서 한 장만 찍는다(다른 화면 인쇄에는 영향 없음). */
@media print {
  body.idash-printing * {
    visibility: hidden;
  }

  body.idash-printing .idash-report,
  body.idash-printing .idash-report * {
    visibility: visible;
  }

  body.idash-printing .idash-report {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    border: 0;
    box-shadow: none;
    background: #fff;
    color: #000;
  }

  body.idash-printing .idash-report .idash-table th,
  body.idash-printing .idash-report .idash-table td {
    color: #000;
    background: #fff;
  }
}

@media (max-width: 560px) {
  .idash-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .idash-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

/* J단계 도구·용어 */
.idash-sim-result {
  margin: 12px 0 4px;
  font-size: 1.05rem;
  color: var(--ink);
}

.idash-sim-result strong {
  color: var(--brand);
}

.idash-glossary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.idash-glossary div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}

.idash-glossary dt {
  font-weight: 700;
  color: var(--ink);
}

.idash-glossary dd {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

/* 온기상담 게시판 (2026-11-08) */
.idash-onki-post summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.idash-onki-post summary .hint {
  margin-left: auto;
}

.idash-check-field > span:last-child {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: var(--ctl-h);
  white-space: nowrap;
}

.idash-check-field input[type="checkbox"] {
  flex: none;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
}

/* 보고서·자료 하위 메뉴가 3개로 늘어 좁은 화면에서 글자가 세로로 꺾이지 않게 옆으로 민다. */
.idash-subnav {
  max-width: 100%;
  overflow-x: auto;
}

.idash-subnav button {
  flex: none;
  white-space: nowrap;
}

.idash-dept-head .idash-chips {
  margin: 0;
}
