/* =========================================================================
   딜브릿지 — dc.css  (⚡ DC 스크리닝 탭 · 물건 지도 DC·수전 레이어)
   모든 클래스는 dcs- 접두사로 기존 화면과 충돌하지 않게 합니다. (2026-12-02)
   ========================================================================= */

/* ───────────────────────── ⚡ DC 스크리닝 탭 ───────────────────────── */
.dcs-view {
  height: calc(100vh - var(--header-h) - var(--tabs-h));
  overflow: auto;
  background: var(--bg);
}
.dcs-shell { max-width: 1680px; margin: 0 auto; padding: 14px 16px 40px; }

.dcs-top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.dcs-title h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.dcs-title p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.dcs-top-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }

.dcs-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 12.2px; font-weight: 650; padding: 7px 12px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.dcs-btn:hover { background: var(--panel-2); }
.dcs-btn.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.dcs-btn.sm { padding: 5px 10px; font-size: 11.4px; }

/* 안내(각주) 박스 */
.dcs-notes {
  background: #fffdf5; border: 1px solid #f0e2b6; border-radius: var(--radius);
  padding: 9px 12px; margin-bottom: 10px; font-size: 11.4px; line-height: 1.65; color: #6b5a1f;
}
.dcs-notes b { color: #8a6d12; }
.dcs-notes ul { margin: 3px 0 0; padding-left: 16px; }
.dcs-notes li { margin: 1px 0; }
.dcs-notes code { background: #fff7dd; border-radius: 4px; padding: 0 4px; font-size: 11px; }

/* 필터 */
.dcs-filters {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow-sm); margin-bottom: 10px;
}
.dcs-frow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dcs-frow + .dcs-frow { margin-top: 8px; }
.dcs-search { position: relative; flex: 1 1 260px; min-width: 200px; }
.dcs-search input {
  width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 30px 0 30px; font-size: 12.6px; font-family: inherit; color: var(--text); background: var(--panel-2);
}
.dcs-search input:focus { outline: 2px solid #cfe3fb; border-color: var(--accent); background: #fff; }
.dcs-search .dcs-sico { position: absolute; left: 9px; top: 8px; font-size: 13px; color: var(--muted); }
.dcs-search .dcs-sclear {
  position: absolute; right: 6px; top: 5px; border: 0; background: transparent;
  color: var(--muted); font-size: 16px; cursor: pointer; line-height: 1;
}
.dcs-chip {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 12px; font-weight: 650; padding: 6px 10px; border-radius: 999px; cursor: pointer;
  white-space: nowrap;
}
.dcs-chip:hover { background: var(--panel-2); }
.dcs-chip.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.dcs-chip .dcs-n { opacity: .72; font-weight: 600; margin-left: 4px; font-size: 11px; }
.dcs-select {
  height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 12.2px; color: var(--text); font-family: inherit; padding: 0 8px;
}
.dcs-check { display: inline-flex; align-items: center; gap: 5px; font-size: 11.8px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.dcs-count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.dcs-count b { color: var(--navy); }

/* 표 */
.dcs-tablewrap {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: auto; max-height: calc(100vh - var(--header-h) - var(--tabs-h) - 300px);
}
.dcs-table { width: 100%; border-collapse: collapse; font-size: 11.8px; min-width: 1280px; }
.dcs-table.sites { min-width: 1620px; }
.dcs-table.sites td:nth-child(1), .dcs-table.sites td:nth-child(3), .dcs-table.sites td:nth-child(4),
.dcs-table.sites td:nth-child(5), .dcs-table.sites td:nth-child(9), .dcs-table.sites td:nth-child(10),
.dcs-table.sites td:nth-child(11), .dcs-table.sites td:nth-child(12), .dcs-table.sites td:nth-child(18),
.dcs-table.subs td { white-space: nowrap; }
.dcs-table thead th {
  position: sticky; top: 0; z-index: 2; background: #f4f7fb; color: var(--navy-3);
  font-size: 11px; font-weight: 750; text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.dcs-table thead th:hover { background: #e9eff7; }
.dcs-table thead th .dcs-sort { color: #a9b7c8; margin-left: 3px; font-size: 9.5px; }
.dcs-table thead th.is-sort { color: var(--navy); }
.dcs-table tbody td { padding: 7px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; color: var(--text); }
.dcs-table tbody tr:hover { background: #f7fbff; }
.dcs-table tbody tr.is-sel { background: #eaf4ff; }
.dcs-table .dcs-c-name { min-width: 220px; max-width: 300px; }
.dcs-table .dcs-c-name .dcs-nm { font-weight: 700; color: var(--navy); cursor: pointer; }
.dcs-table .dcs-c-name .dcs-nm:hover { text-decoration: underline; }
.dcs-table .dcs-c-name .dcs-sub { display: block; font-size: 10.8px; color: var(--muted); margin-top: 2px; }
.dcs-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dcs-table .dcs-clip { display: inline-block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.dcs-table .dcs-dim { color: var(--muted); }
.dcs-empty { padding: 30px 12px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* 배지 */
.dcs-badge {
  display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10.4px;
  font-weight: 700; line-height: 1.6; white-space: nowrap; border: 1px solid transparent;
}
.dcs-badge.soft { background: #eef2f7; color: #56677c; border-color: #e2e9f2; }
.dcs-badge.warn { background: #fff4e0; color: #a35c00; border-color: #ffe2b0; }
.dcs-badge.gray { background: #f1f3f6; color: #7b8798; border-color: #e6eaf0; }
.dcs-badge.zero { background: #fdeaea; color: #b3261e; border-color: #f6cccc; }
.dcs-badge.diff-low { background: #e7f7ee; color: #12683f; border-color: #c6ecd8; }
.dcs-badge.diff-mid { background: #fff4e0; color: #8a5a00; border-color: #ffe2b0; }
.dcs-badge.diff-high { background: #fdeaea; color: #a3241c; border-color: #f6cccc; }
.dcs-badge.t-base { background: #e8f0fe; color: #1a4f9c; border-color: #d3e2fb; }
.dcs-badge.t-permit { background: #f1eafd; color: #5b2ea6; border-color: #e6dafb; }
.dcs-badge.t-deal { background: #fdeaf1; color: #9c1446; border-color: #f8d3e0; }
.dcs-badge.t-public { background: #e5f6f2; color: #0d6b5b; border-color: #c9ece2; }
.dcs-badge.t-private { background: #fdf0e3; color: #8a5410; border-color: #f7e0c4; }
.dcs-badge.t-sub { background: #eef2f7; color: #4a5a6e; border-color: #e2e9f2; }
.dcs-badge .dcs-kvn { font-weight: 800; }
.dcs-i {
  display: inline-block; width: 13px; height: 13px; line-height: 13px; text-align: center;
  border-radius: 50%; background: #e6edf6; color: #48627f; font-size: 9.5px; font-weight: 800;
  cursor: help; margin-left: 3px; vertical-align: 1px;
}

/* 상세 패널 */
.dcs-detail {
  position: fixed; top: var(--header-h); right: 0; bottom: 0; width: min(560px, 96vw);
  background: #fff; border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  z-index: 60; display: flex; flex-direction: column;
}
.dcs-dhead { padding: 12px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #f7fafd, #fff); }
.dcs-dhead .dcs-dtop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dcs-dhead h3 { margin: 6px 0 2px; font-size: 16px; line-height: 1.35; color: var(--navy); }
.dcs-dhead .dcs-daddr { font-size: 11.6px; color: var(--muted); }
.dcs-dclose {
  position: absolute; right: 10px; top: 10px; border: 1px solid var(--line); background: #fff;
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-size: 15px;
}
.dcs-dbody { overflow: auto; padding: 10px 14px 40px; flex: 1; }
.dcs-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; }
.dcs-kpi { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--panel-2); }
.dcs-kpi .k { font-size: 10.4px; color: var(--muted); font-weight: 650; }
.dcs-kpi .v { font-size: 14.5px; font-weight: 800; color: var(--navy); margin-top: 2px; letter-spacing: -.01em; }
.dcs-kpi .v small { font-size: 10.6px; font-weight: 650; color: var(--muted); margin-left: 3px; }
.dcs-sec { margin: 0 0 12px; }
.dcs-sec h4 {
  margin: 0 0 6px; font-size: 11.4px; color: var(--navy-3); font-weight: 800;
  display: flex; align-items: center; gap: 6px;
}
.dcs-sec h4::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.dcs-kv { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 4px 10px; font-size: 11.8px; line-height: 1.62; }
.dcs-kv dt { color: var(--muted); font-weight: 650; }
.dcs-kv dd { margin: 0; color: var(--text); word-break: break-word; }
.dcs-kv dd a { color: var(--accent); text-decoration: none; }
.dcs-kv dd a:hover { text-decoration: underline; }
.dcs-dfoot { border-top: 1px solid var(--line); padding: 9px 14px; display: flex; gap: 6px; flex-wrap: wrap; background: #fbfcfe; }

/* ───────────────────── 물건 지도 — DC·수전 레이어 패널 ───────────────────── */
.dcs-layer {
  position: absolute; right: 12px; top: 12px; z-index: 12; width: 236px;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md); font-family: var(--font); overflow: hidden;
}
.dcs-layer.dcs-collapsed { width: auto; }
.dcs-layer-head {
  display: flex; align-items: center; gap: 6px; padding: 7px 9px; cursor: pointer;
  background: linear-gradient(180deg, #0b2a4a, #123a63); color: #fff; font-size: 11.8px; font-weight: 800;
}
.dcs-layer-head .dcs-lh-r { margin-left: auto; font-weight: 600; font-size: 10.6px; opacity: .85; }
.dcs-layer-body { padding: 7px 9px 9px; }
.dcs-layer.dcs-collapsed .dcs-layer-body { display: none; }
.dcs-lrow { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 11.6px; color: var(--text); cursor: pointer; }
.dcs-lrow input { margin: 0; width: 13px; height: 13px; accent-color: var(--navy); }
.dcs-lrow .dcs-ln { margin-left: auto; font-size: 10.6px; color: var(--muted); font-weight: 650; }
.dcs-lsub { margin: 2px 0 4px 19px; display: flex; gap: 8px; flex-wrap: wrap; }
.dcs-lsub label { display: inline-flex; align-items: center; gap: 3px; font-size: 10.8px; color: var(--text-2); cursor: pointer; }
.dcs-lsub input { width: 11px; height: 11px; margin: 0; accent-color: var(--navy); }
.dcs-dotc { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.22); }
.dcs-llegend { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.dcs-llegend .dcs-ll { display: flex; align-items: center; gap: 5px; font-size: 10.4px; color: var(--text-2); }
.dcs-llegend .dcs-ring { width: 12px; height: 12px; border-radius: 50%; border: 1.6px solid #64748b; }
.dcs-lnote { margin-top: 6px; font-size: 9.8px; line-height: 1.5; color: var(--muted); }
.dcs-lnote b { color: #8a6d12; }

/* 지도 위 DC 마커 (CustomOverlay) */
.dcs-pin {
  width: 13px; height: 13px; border-radius: 3px; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(9, 27, 48, .45); cursor: pointer; box-sizing: border-box;
}
.dcs-pin.t-base { background: #1d4ed8; }
.dcs-pin.t-permit { background: #7c3aed; }
.dcs-pin.t-deal { background: #be123c; }
.dcs-pin.t-public { background: #0d9488; }
.dcs-pin.t-private { background: #b45309; }
.dcs-pin.is-approx { border-style: dashed; opacity: .72; }
.dcs-pin.is-sel { box-shadow: 0 0 0 3px rgba(29, 78, 216, .35); transform: scale(1.18); }

.dcs-sub-dot {
  border-radius: 50%; box-sizing: border-box; cursor: pointer;
  background: rgba(96, 165, 250, .13); border: 1.6px solid #3b82f6;
}
.dcs-sub-dot.kv345 { background: rgba(245, 158, 11, .14); border-color: #d97706; }
.dcs-sub-dot.kv765 { background: rgba(220, 38, 38, .16); border-color: #dc2626; }
.dcs-sub-dot.noslack { background: transparent; border-style: dashed; border-color: #94a3b8; }
.dcs-sub-dot.zero { background: rgba(220, 38, 38, .05); border-color: #dc2626; border-width: 2.2px; }

.dcs-mapinfo {
  background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow-md);
  padding: 8px 10px; font-family: var(--font); font-size: 11.4px; color: var(--text);
  min-width: 180px; max-width: 250px; line-height: 1.55;
}
.dcs-mapinfo b { color: var(--navy); font-size: 12px; }
.dcs-mapinfo .dcs-mi-row { color: var(--text-2); }
.dcs-mapinfo .dcs-mi-note { color: #8a6d12; font-size: 10.2px; margin-top: 3px; }
.dcs-mapinfo .dcs-mi-act {
  margin-top: 6px; width: 100%; border: 1px solid var(--line); background: var(--panel-2);
  border-radius: 7px; padding: 4px 6px; font-size: 11px; font-weight: 700; color: var(--navy); cursor: pointer;
}
.dcs-mapinfo .dcs-mi-act:hover { background: #eaf2fd; }

/* 모바일 */
@media (max-width: 820px) {
  .dcs-shell { padding: 10px 10px 30px; }
  .dcs-top-actions { width: 100%; margin-left: 0; }
  .dcs-tablewrap { max-height: none; }
  .dcs-layer { right: 8px; top: 8px; width: 208px; }
  .dcs-layer.dcs-collapsed { width: auto; }
}
