/* =========================================================================
   딜브릿지 — demand.css  (📦 화주 수요 · 임차 매칭 탭 / 물류 준공예정 레이어)
   모든 클래스는 dmd- 접두사로 기존 화면(dc·pool 등)과 충돌하지 않게 합니다. (2026-12-02)
   ========================================================================= */

/* ───────────────────────── 📦 화주 수요 탭 ───────────────────────── */
.dmd-view {
  height: calc(100vh - var(--header-h) - var(--tabs-h));
  overflow: auto;
  background: var(--bg);
}
.dmd-shell { max-width: 1680px; margin: 0 auto; padding: 14px 16px 40px; }

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

.dmd-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;
}
.dmd-btn:hover { background: var(--panel-2); }
.dmd-btn.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.dmd-btn.sm { padding: 5px 10px; font-size: 11.4px; }

.dmd-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;
}
.dmd-notes b { color: #8a6d12; }
.dmd-notes ul { margin: 3px 0 0; padding-left: 16px; }
.dmd-notes li { margin: 1px 0; }

/* KPI */
.dmd-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.dmd-kpi-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 12px; box-shadow: var(--shadow-sm);
}
.dmd-kpi-label { font-size: 11px; color: var(--muted); font-weight: 650; }
.dmd-kpi-val { font-size: 19px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; margin-top: 2px; }
.dmd-kpi-val small { font-size: 11.5px; font-weight: 650; color: var(--text-2); margin-left: 3px; }
.dmd-kpi-sub { font-size: 10.8px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* 서브탭 */
.dmd-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.dmd-tab {
  border: 1px solid var(--line); background: #fff; color: var(--text-2);
  font-size: 12.4px; font-weight: 700; padding: 7px 13px; border-radius: 999px; cursor: pointer;
}
.dmd-tab.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.dmd-tab .dmd-n { font-weight: 700; opacity: .72; margin-left: 4px; font-size: 11px; }

/* 필터 */
.dmd-filters {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow-sm); margin-bottom: 10px;
}
.dmd-frow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dmd-frow + .dmd-frow { margin-top: 8px; }
.dmd-search { position: relative; flex: 1 1 280px; min-width: 200px; }
.dmd-search input {
  width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 30px; font-size: 12.6px; font-family: inherit; color: var(--text); background: var(--panel-2);
}
.dmd-search input:focus { outline: 2px solid #cfe3fb; border-color: var(--accent); background: #fff; }
.dmd-search .dmd-sico { position: absolute; left: 9px; top: 8px; font-size: 13px; color: var(--muted); }
.dmd-search .dmd-sclear {
  position: absolute; right: 6px; top: 5px; border: 0; background: transparent;
  color: var(--muted); font-size: 16px; cursor: pointer; line-height: 1;
}
.dmd-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;
}
.dmd-chip:hover { background: var(--panel-2); }
.dmd-chip.is-on { background: #e8f1fb; border-color: #9dc4ea; color: #0b4f96; }
.dmd-chip .dmd-n { font-size: 10.6px; color: var(--muted); margin-left: 4px; }
.dmd-chip.is-on .dmd-n { color: #2f6fae; }
.dmd-select {
  height: 32px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 12.2px; color: var(--text); padding: 0 8px; font-family: inherit;
}
.dmd-count { font-size: 12px; color: var(--muted); margin-left: auto; }
.dmd-count b { color: var(--navy); }

/* 배지 */
.dmd-badge {
  display: inline-flex; align-items: center; gap: 3px; border-radius: 6px;
  font-size: 10.8px; font-weight: 750; padding: 2px 6px; line-height: 1.5; white-space: nowrap;
  border: 1px solid transparent;
}
.dmd-badge.ev-A { background: #e7f6ec; color: #166534; border-color: #b7e3c5; }
.dmd-badge.ev-B { background: #e8f1fb; color: #0b4f96; border-color: #b6d3ee; }
.dmd-badge.ev-C { background: #fdf3e3; color: #8a5a09; border-color: #eecf9a; }
.dmd-badge.ev-D { background: #f1f2f5; color: #55606e; border-color: #d9dde4; }
.dmd-badge.ev-- { background: #f1f2f5; color: #55606e; }
.dmd-badge.mb-lease { background: #e6f6f4; color: #0f5f58; border-color: #b3e0da; }
.dmd-badge.mb-self { background: #f3edfb; color: #5b2e91; border-color: #d8c8ef; }
.dmd-badge.mb-out { background: #f7e9e9; color: #8c2f2f; border-color: #ebc2c2; }
.dmd-badge.gray { background: #f3f5f8; color: #5b6878; border-color: #dfe4ea; }
.dmd-badge.warn { background: #fff7e6; color: #8a5a09; border-color: #f0d9a8; }
.dmd-badge.teal { background: #e6f6f4; color: #0f5f58; border-color: #b3e0da; }

.dmd-i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; border-radius: 50%; background: #e7edf5; color: #4a5f78;
  font-size: 9.5px; font-weight: 800; margin-left: 3px; cursor: help; vertical-align: middle;
}
.dmd-dim { color: var(--muted); }

/* 화주 카드 */
.dmd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.dmd-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 12px 10px; box-shadow: var(--shadow-sm); cursor: pointer; text-align: left;
  font-family: inherit; color: inherit; display: block; width: 100%;
}
.dmd-card:hover { border-color: #9dc4ea; box-shadow: var(--shadow-md); }
.dmd-card.is-sel { border-color: var(--accent); box-shadow: 0 0 0 2px #cfe3fb; }
.dmd-c-top { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dmd-c-name { font-size: 14px; font-weight: 800; color: var(--navy); letter-spacing: -.01em; }
.dmd-c-sector { font-size: 11px; color: var(--muted); }
.dmd-c-dtype { font-size: 12.2px; color: var(--text); font-weight: 650; margin-top: 5px; display: block; }
.dmd-c-meta { display: flex; gap: 4px 10px; flex-wrap: wrap; font-size: 11.4px; color: var(--text-2); margin-top: 3px; }
.dmd-c-meta b { color: var(--navy); font-weight: 750; }
.dmd-c-risk {
  font-size: 11px; color: #7a4a1a; background: #fdf7ec; border: 1px solid #f3e3c2;
  border-radius: 6px; padding: 4px 7px; margin-top: 6px; line-height: 1.5; display: block;
}
.dmd-c-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.dmd-c-cnt { font-size: 11px; color: var(--muted); margin-left: auto; }

/* 표 */
.dmd-tablewrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-sm); }
.dmd-table { width: 100%; border-collapse: collapse; font-size: 12.1px; }
.dmd-table th {
  position: sticky; top: 0; background: #f4f7fb; color: #44536a; font-weight: 750;
  font-size: 11.4px; text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1;
}
.dmd-table td { padding: 6px 9px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.dmd-table tbody tr:hover { background: #f7fbff; }
.dmd-table tbody tr.is-sel { background: #eef6ff; }
.dmd-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dmd-table .dmd-nm { color: #0b4f96; font-weight: 700; cursor: pointer; }
.dmd-table .dmd-nm:hover { text-decoration: underline; }
.dmd-table .dmd-sub { display: block; font-size: 10.8px; color: var(--muted); margin-top: 1px; }
.dmd-sort { color: #9aa9bb; font-size: 10px; margin-left: 2px; }
.dmd-table th.is-sort { color: var(--navy); background: #e9f1fa; }
.dmd-empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 12.4px; }

/* 점수 막대 */
.dmd-score { display: inline-flex; align-items: center; gap: 6px; }
.dmd-score b { font-size: 13px; color: var(--navy); font-variant-numeric: tabular-nums; }
.dmd-score .dmd-bar { width: 58px; height: 6px; border-radius: 99px; background: #e7edf5; overflow: hidden; display: inline-block; }
.dmd-score .dmd-bar i { display: block; height: 100%; background: linear-gradient(90deg, #2f80c9, #0b2a4a); }
.dmd-parts { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.dmd-part {
  font-size: 10.2px; font-weight: 700; padding: 1px 5px; border-radius: 5px;
  background: #f1f5fa; color: #46617f; border: 1px solid #dfe7f0;
}
.dmd-part.p-region { background: #e8f1fb; color: #0b4f96; border-color: #b6d3ee; }
.dmd-part.p-size { background: #e6f6f4; color: #0f5f58; border-color: #b3e0da; }
.dmd-part.p-temp { background: #fdf3e3; color: #8a5a09; border-color: #eecf9a; }
.dmd-part.p-timing { background: #f3edfb; color: #5b2e91; border-color: #d8c8ef; }

/* 상세 패널 */
.dmd-detail {
  position: fixed; top: calc(var(--header-h) + var(--tabs-h)); right: 0; bottom: 0; width: 420px;
  background: #fff; border-left: 1px solid var(--line); box-shadow: var(--shadow-lg);
  z-index: 30; overflow: auto; padding: 12px 14px 40px;
}
.dmd-detail-head { display: flex; align-items: flex-start; gap: 8px; }
.dmd-detail-head h3 { margin: 0; font-size: 16px; color: var(--navy); letter-spacing: -.01em; }
.dmd-detail-x {
  margin-left: auto; border: 1px solid var(--line); background: #fff; color: var(--text-2);
  border-radius: 8px; width: 28px; height: 28px; cursor: pointer; font-size: 15px; line-height: 1;
}
.dmd-detail-sub { font-size: 11.6px; color: var(--muted); margin-top: 3px; }
.dmd-dsec { margin-top: 12px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.dmd-dsec h4 { margin: 0 0 6px; font-size: 11.6px; color: #44536a; font-weight: 800; letter-spacing: .01em; }
.dmd-kv { display: grid; grid-template-columns: 74px 1fr; gap: 3px 8px; font-size: 12px; line-height: 1.55; }
.dmd-kv dt { color: var(--muted); font-weight: 650; }
.dmd-kv dd { margin: 0; color: var(--text); }
.dmd-quote { font-size: 11.4px; color: var(--text-2); line-height: 1.6; margin: 0; }
.dmd-cand {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 9px; margin-bottom: 6px; background: #fcfdff;
}
.dmd-cand-h { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dmd-cand-h .dmd-nm { font-size: 12.6px; font-weight: 750; color: var(--navy); }
.dmd-cand-meta { font-size: 11.2px; color: var(--text-2); margin-top: 2px; line-height: 1.55; }
.dmd-cand-reason { font-size: 10.8px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.dmd-cand-actions { margin-top: 5px; display: flex; gap: 5px; flex-wrap: wrap; }
.dmd-mini {
  border: 1px solid var(--line); background: #fff; color: #0b4f96; border-radius: 6px;
  font-size: 10.8px; font-weight: 700; padding: 3px 7px; cursor: pointer;
}
.dmd-mini:hover { background: #eef6ff; }
.dmd-mini[disabled] { color: #9aa9bb; cursor: not-allowed; background: #f7f9fc; }

/* 자체·기확보 영역 */
.dmd-own {
  background: #faf7fe; border: 1px dashed #cdb8e8; border-radius: 8px; padding: 8px 10px;
}
.dmd-own .dmd-own-h { font-size: 11.6px; font-weight: 800; color: #5b2e91; margin-bottom: 4px; }
.dmd-own-item { font-size: 11.4px; color: var(--text-2); padding: 4px 0; border-top: 1px dashed #e4d8f3; line-height: 1.5; }
.dmd-own-item:first-of-type { border-top: 0; }
.dmd-own-item b { color: #4a2477; }

/* 시장·권역 */
.dmd-grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; }
.dmd-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; box-shadow: var(--shadow-sm); }
.dmd-panel h3 { margin: 0 0 8px; font-size: 13px; color: var(--navy); }
.dmd-mkt { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.dmd-mkt-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--panel-2); }
.dmd-mkt-card .k { font-size: 10.8px; color: var(--muted); font-weight: 700; }
.dmd-mkt-card .v { font-size: 12.2px; color: var(--text); margin-top: 2px; line-height: 1.55; }
.dmd-src { list-style: none; margin: 0; padding: 0; font-size: 11.4px; }
.dmd-src li { padding: 4px 0; border-top: 1px solid var(--line-2); line-height: 1.5; }
.dmd-src li:first-child { border-top: 0; }
.dmd-src a { color: #0b4f96; text-decoration: none; }
.dmd-src a:hover { text-decoration: underline; }
.dmd-src .dmd-src-meta { color: var(--muted); font-size: 10.6px; margin-left: 4px; }

/* ───────────────────── 지도: 📦 물류 공급 레이어 패널 ───────────────────── */
.dmd-layer {
  position: absolute; right: 12px; bottom: 16px; z-index: 12; width: 238px;
  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;
}
.dmd-layer.dmd-collapsed { width: auto; }
.dmd-layer-head {
  display: flex; align-items: center; gap: 6px; padding: 7px 9px; cursor: pointer;
  background: linear-gradient(180deg, #0f5f58, #14776d); color: #fff; font-size: 11.8px; font-weight: 800;
}
.dmd-layer-head .dmd-lh-r { margin-left: auto; font-weight: 600; font-size: 10.6px; opacity: .9; }
.dmd-layer-body { padding: 7px 9px 9px; }
.dmd-layer.dmd-collapsed .dmd-layer-body { display: none; }
.dmd-lrow { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 11.6px; color: var(--text); cursor: pointer; }
.dmd-lrow input { margin: 0; width: 13px; height: 13px; accent-color: #0f5f58; }
.dmd-lrow .dmd-ln { margin-left: auto; font-size: 10.6px; color: var(--muted); font-weight: 650; }
.dmd-lsub { margin: 2px 0 5px 19px; display: flex; gap: 8px; flex-wrap: wrap; }
.dmd-lsub label { display: inline-flex; align-items: center; gap: 3px; font-size: 10.8px; color: var(--text-2); cursor: pointer; }
.dmd-lsub input { width: 11px; height: 11px; margin: 0; accent-color: #0f5f58; }
.dmd-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); }
.dmd-sqc { display: inline-block; width: 9px; height: 9px; border-radius: 2px; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.22); }
.dmd-lnote { margin-top: 6px; font-size: 9.8px; line-height: 1.5; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 5px; }
.dmd-lsep { height: 1px; background: var(--line); margin: 5px 0 4px; }

/* 지도 마커 */
.dmd-pin {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(9, 27, 48, .45); cursor: pointer; box-sizing: border-box;
}
.dmd-pin.k-lease { background: #0f766e; }
.dmd-pin.k-lease.is-unverified { background: #7fb8b2; }
.dmd-pin.k-pipe { background: #b45309; border-radius: 3px; }
.dmd-pin.k-pipe.is-approx { border-style: dashed; opacity: .82; }

.dmd-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.6px; color: var(--text); min-width: 190px; max-width: 260px;
}
.dmd-mapinfo b { color: var(--navy); font-size: 12.4px; }
.dmd-mapinfo .dmd-mi-row { margin-top: 3px; color: var(--text-2); line-height: 1.5; }
.dmd-mapinfo .dmd-mi-note { margin-top: 4px; font-size: 10.2px; color: var(--muted); line-height: 1.45; }
.dmd-mapinfo .dmd-mi-act {
  margin-top: 6px; border: 1px solid var(--line); background: #fff; color: #0b4f96;
  border-radius: 6px; font-size: 10.8px; font-weight: 700; padding: 3px 7px; cursor: pointer;
}

/* 반응형 */
@media (max-width: 1100px) {
  .dmd-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dmd-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .dmd-shell { padding: 10px 10px 30px; }
  .dmd-cards { grid-template-columns: 1fr; }
  .dmd-detail { width: 100%; }
  .dmd-layer { right: 8px; bottom: 8px; width: 200px; }
  .dmd-layer.dmd-collapsed { width: auto; }
  .dmd-kpi-val { font-size: 17px; }
}
