/* =============================
   DISTRIBUTION.CSS
   공공서비스 분포 전용
   distribution.js 와 연결
   현재 화면 기준 최종 적용값만 남김
   중복 선언 제거 완료
   ============================= */

#content-distribution {
  padding: 12px 18px 18px 18px;
  background: #ffffff;
}

.distribution-shell {
  width: 100%;
  max-width: 1480px;
  min-width: 1200px;
  margin: 0 auto;
}

/* =============================
   상단 탭
   ============================= */
.distribution-tabs {
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-bottom: -3px;
  position: relative;
  z-index: 3;
}

.distribution-tab {
  width: 280px;
  min-width: 280px;
  height: 60px;
  padding: 0 24px;
  border: none;
  border-radius: 22px 22px 0 0;
  background: #f2f2f0;
  color: #8b8b8b;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -1px;
  text-align: left;
  cursor: pointer;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.distribution-tab.active {
  background: #006537;
  color: #ffffff;
  height: 60px;
  z-index: 1;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -1px;
  box-shadow:
    0 -3px 10px rgba(0, 0, 0, 0.08),
    0 1px 0 rgba(0, 101, 55, 1);
}

/* =============================
   메인 보드 / 필터
   ============================= */
.distribution-board {
  width: 100%;
  height: auto;
  min-height: auto;
  padding-bottom: 33px;
  margin-top: 4px;
  background: #006537;
  border-radius: 0 20px 20px 20px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  position: relative;
  z-index: 2;
}

.distribution-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px 12px 6px 12px;
}

.distribution-search-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.distribution-field {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  background: #ffffff;
  border: 1px solid #d7d7d7;
}

.distribution-field-label {
  width: 78px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-right: 1px solid #d7d7d7;
  font-size: 14px;
  color: #555;
  flex: 0 0 60px;
}

.distribution-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  padding: 0 10px;
  font-size: 14px;
  color: #444;
  background: transparent;
}

.distribution-input::placeholder {
  color: #b1b1b1;
}

.distribution-datestamp {
  flex: 0 0 auto;
  color: #e6f1eb;
  font-size: 13px;
  white-space: nowrap;
  display: flex;
  align-items: flex-end;
  height: 34px;
  padding-bottom: 2px;
  margin-right: 8px;
}

/* =============================
   위치 선택 패널
   ============================= */
.distribution-field-location {
  position: relative;
}

.distribution-location-trigger {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  height: 100%;
  min-height: 34px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 0;
  box-sizing: border-box;
  font-size: 14px;
  line-height: 1;
  color: #333;
  cursor: pointer;
}



.distribution-location-col:last-child {
  border-right: none;
}

.distribution-location-col-title {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  background: #f7f7f7;
  border-bottom: 1px solid #ececec;
}

.distribution-search-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.distribution-location-item:hover {
  background: #f3f6f4;
}

.distribution-location-item.active {
  background: #e7f0eb;
  font-weight: 700;
  color: #006537;
}

/* =============================
   본문 2단
   ============================= */
.distribution-body {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #ffffff;
  min-height: 500px;
  margin: 0 12px 4px 12px;
}

.distribution-main {
  flex: 1;
  min-width: 0;
  padding: 0;
}

.distribution-side {
  flex: 0 0 26%;
  background: #ffffff;
  border-left: 1px solid #ffffff;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.distribution-row {
  display: flex;
  align-items: flex-start;
  border-top: 12px solid #ffffff;
}

/* =============================
   패널 공통
   ============================= */
.distribution-panel,
.distribution-side-panel {
  background: #ffffff;
  margin: 0;
}


.distribution-panel-title {
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -1px;
}

.distribution-panel-body {
  background: #ffffff;
  min-height: 150px;
}

.distribution-panel-feature {
  margin: 0 12px 0 12px;
  background: #ffffff;
}

.distribution-panel-body-feature {
  background: #ffffff;
  padding: 0;
  min-height: auto;
}

.distribution-panel-mainchart {
  background: transparent;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -1px;
  padding-top: 12px;
  margin: 22px 10px 0 25px;
  position: relative;
  z-index: 0;
}

.distribution-panel-mainchart::before {
  content: "";
  position: absolute;
  top: 0;
  left: -25px;
  width: calc(100% + 25px);
  height: 100%;
  background: #f3f6f3;
  z-index: -1;
}

.distribution-panel-body-mainchart {
  min-height: 160px;
  padding: 10px 16px 16px 16px;
  background: transparent;
  position: relative;
  z-index: 0;
}

.distribution-panel-body-mainchart::before {
  content: "";
  position: absolute;
  top: 0;
  left: -25px;
  width: calc(100% + 25px);
  height: 100%;
  background: #f3f6f3;
  z-index: -1;
}

.distribution-panel-half {
  flex: 1 1 0;
  min-width: 0;
  background: #ffffff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 4px 0 0 25px;
  align-self: flex-start;
}

.distribution-panel-half+.distribution-panel-half {
  border-left: 1px solid #ffffff;
}

.distribution-panel-body-half {
  min-height: 180px;
  padding: 8px 0 8px 16px;
  background: #ffffff;
}

/* =============================
   오른쪽 키맵 / 보조설명
   ============================= */
.distribution-side-map {
  height: 270px;
  flex: 0 0 270px;
  background: #f4f4f2;
  border-bottom: 14px solid #ffffff;
  margin: 0;
  padding: 0;
}

.distribution-keymap-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

#distribution-keymap {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #ffffff;
}

#distribution-keymap .leaflet-container {
  background: #ffffff;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

#distribution-keymap .leaflet-control-container {
  display: none;
}

.distribution-sido-label {
  background: transparent;
  border: none;
  box-shadow: none;
}

.distribution-sido-label div {
  font-size: 12px;
  font-weight: 600;
  color: #7a7a7a;
  text-align: center;
  white-space: nowrap;
  letter-spacing: -0.2px;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.9);
}

.distribution-selected-label {
  background: transparent;
  border: none;
}

.distribution-selected-label div {
  display: inline-block;
  padding: 4px 10px 5px;
  background: rgba(125, 125, 125, 0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border-radius: 14px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(147, 147, 147, 0.18);
}

.distribution-marker-icon {
  width: 40px !important;
  height: auto !important;
}

.distribution-side-guide {
  background: #ffffff;
  margin: 0;
  padding: 0;
}

.distribution-side-guide .distribution-panel-title {
  display: none;
}

.distribution-guide-note {
  font-family: 'Pretendard', sans-serif;
  display: inline-flex;
  align-items: left;
  justify-content: left;

  margin: 0 auto -20px;
  padding: 6px 18px;

  border-radius: 999px;
  background: #b8c3be;
  color: #ffffff;

  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.distribution-panel-body-guide {
  min-height: 360px;
  padding: 20px 22px;
  background: #ffffff;
}

.distribution-guide-text {
  font-size: 54px;
  font-weight: 800;
  color: #006537;
  line-height: 1.05;
}

/* =============================
   상단 인포그래픽
   ============================= */
#dist-chart-feature {
  width: 100%;
  background: #ffffff;
  min-height: 250px;
}

.dist-feature-empty {
  flex: 1;
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 25px;
  font-weight: 300;
  color: #afafaf;
  line-height: 1.6;
  letter-spacing: -0.4px;
}

.dist-feature-wrap {
  width: 100%;
  background: #ffffff;
  padding: 10px 0 0 0;
  min-height: 230px;
}

.dist-feature-wrap-empty {
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.dist-feature-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 0 18px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.8px;
  color: #3a3a3a;
}

.dist-feature-breadcrumb .dot {
  color: #6d6d6d;
  font-weight: 400;
}

.dist-feature-breadcrumb .current-fac {
  color: #006537;
  font-weight: 700;
}

.dist-feature-head {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 14px 18px 0 18px;
}

.dist-feature-status {
  font-size: 48px;
  line-height: 1;
  font-weight: 800;
  margin-top: 24px;
  letter-spacing: -2px;
}

.dist-feature-status-sub {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 400;
  color: #555;
  padding-bottom: 6px;
  letter-spacing: -1px;
}

.dist-status-under {
  color: var(--status-under);
}

.dist-status-fit {
  color: #6f7f79;
}

.dist-status-over {
  color: var(--status-over);
}

.dist-status-unknown {
  color: #7d7d7d;
}

.dist-feature-desc {
  padding: 4px 18px 10px 18px;
  font-size: 16px;
  font-weight: 500;
  color: #4a4a4a;
  letter-spacing: -0.6px;
  border-bottom: 1px solid #cfd5cf;
}

.dist-feature-kpi {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #ffffff;
}

.dist-kpi-item {
  min-height: 84px;
  padding: 13px 18px 14px 18px;
  border-right: 1px solid #cfd5cf;
}

.dist-kpi-item:last-child {
  border-right: none;
}

.dist-kpi-label {
  font-size: 16px;
  font-weight: 500;
  color: #4f4f4f;
  line-height: 1.35;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.dist-kpi-value {
  font-size: 24px !important;
  line-height: 1.1;
  font-weight: 700;
  color: #111;
  letter-spacing: -1.5px;
}

.dist-kpi-value.dist-kpi-text {
  font-size: 22px;
  word-break: keep-all;
}

.dist-feature-empty {
  padding: 24px 18px;
  font-size: 25px;
  color: #afafaf;
}

/* =============================
   분포 차트 영역 / 레전드
   ============================= */
.dist-empty {
  padding: 24px 28px;
  font-size: 25px;
  font-weight: 300;
  color: #afafaf;
  line-height: 1.6;
  letter-spacing: -0.2px;
}

.dist-empty-center {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.chart-legend {
  position: absolute;
  top: 5px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 160px;
  padding: 10px 12px 0 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  font-size: 15px;
}

.chart-legend .legend-row {
  display: flex;
  align-items: center;
  margin: 0;
}

.chart-legend .legend-box {
  width: 40px;
  height: 14px;
  margin-right: 3px;
}

.chart-legend .shortage {
  background: var(--status-under);
}

.chart-legend .adequate {
  background: var(--status-fit);
}

.chart-legend .surplus {
  background: var(--status-over);
}

.dist-placeholder {
  width: 100%;
  min-height: 160px;
  border: 1px dashed #c8c8c8;
  border-radius: 10px;
  background: #fafaf8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7b7b7b;
  font-size: 14px;
  text-align: center;
  padding: 16px;
}

.bar-selected {
  box-shadow: 0 3px 10px rgba(10, 67, 15, 0.692);
  z-index: 3;
}

/* =============================
   분포 반응형
   ============================= */
@media (max-width: 1440px) {
  .distribution-shell {
    max-width: 1280px;
  }
}

@media (max-width: 1400px) {
  .dist-feature-status {
    font-size: 46px;
  }

  .dist-kpi-value {
    font-size: 22px !important;
    display: flex;
    align-items: center;
  }

  .dist-kpi-value.dist-kpi-text {
    font-size: 19px;
  }
}

.dist-kpi-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dist-base-toggle-single {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 58px;
  height: 30px;
  padding: 0 10px;

  border: 2px solid #006537;
  border-radius: 999px;
  background: #939598;
  color: #ffffff;

  font-family: 'Pretendard', sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.12);
}

.dist-base-toggle:hover {
  border-color: #bfbfbf;
}

@media (max-width: 1280px) {
  #content-distribution {
    padding: 12px 14px 18px 14px;
  }

  .distribution-shell {
    max-width: 100%;
  }

  .distribution-tab {
    width: 250px;
    min-width: 250px;
    height: 60px;
    font-size: 18px;
  }

  .distribution-side {
    width: 230px;
    flex: 0 0 230px;
  }
}

@media (max-width: 1180px) {
  .dist-feature-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dist-kpi-item:nth-child(2n) {
    border-right: none;
  }
}

@media (max-width: 1024px) {
  #content-distribution {
    padding: 12px;
  }

  .distribution-filterbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .distribution-search-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .distribution-field {
    width: 100%;
    flex: 1 1 100%;
  }

  .distribution-datestamp {
    white-space: normal;
  }

  .distribution-body {
    gap: 16px;
  }

  .distribution-side {
    width: 100%;
    flex: 0 0 auto;
    border-left: none;
    border-top: 1px solid #d9d9d9;
  }
}

@media (max-width: 768px) {
  .distribution-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .distribution-tab {
    width: 100%;
    min-width: 0;
    height: 62px;
    border-radius: 18px 18px 0 0;
    font-size: 17px;
  }

  .distribution-row {
    flex-direction: column;
    border-top: 8px solid #ffffff;
  }
}

/* ============================= */
/* distribution guide text */
/* ============================= */

.distribution-panel-body-guide {
  min-height: 220px;
  padding: 0 0 0 0;
  margin-right: 10px;
  background: #ffffff;
  margin-right: 10px;
  background: #ffffff;

  display: flex;
  flex-direction: column;
}

.distribution-guide-text {
  font-family: 'Noto Serif KR', serif;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;

  flex: 1;
  min-height: 100%;

  text-align: center;
  gap: 24px;
  padding: 0 0 24px 0;

  color: #232323;
  letter-spacing: -2px;
  line-height: 1.2;
  word-break: keep-all;
}

.distribution-guide-text .guide-line-main {
  font-size: 27px;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 12px;
  letter-spacing: -1px;
}

.distribution-guide-text .guide-line-sub {
  font-size: 27px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -1px;
}

.distribution-guide-text .guide-line-impact {
  font-size: 27px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -1px;
  color: #e4007f;
}

.distribution-guide-text .guide-emphasis {
  color: #e4007f;
  font-size: 32px;
  font-weight: 1000;
  letter-spacing: -2px;
}

.distribution-guide-text .guide-status-under,
.distribution-guide-text .guide-status-fit,
.distribution-guide-text .guide-status-over,
.distribution-guide-text .guide-impact {
  color: #e4007f;
  font-weight: 1000;
}

.distribution-guide-empty {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #afafaf;
  font-size: 25px;
  line-height: 1.7;
  letter-spacing: -0.4px;
  font-family: 'Pretendard', sans-serif;
  font-weight: 300;
}

.guide-divider {
  width: 80%;
  height: 2px;
  margin: 25px auto 0 auto;

  background: linear-gradient(to right,
      transparent,
      rgba(0, 0, 0, 0.15),
      transparent);
}

.guide-note {
  font-family: 'Pretendard', sans-serif;
  font-size: 17px;
  font-weight: 400;
  color: #666;
  line-height: 1.5;

  text-align: left;
  width: 80%;
  margin: 0 auto;
}

/* ============================= */
/* location dropdown click fix */
/* ============================= */

.distribution-board {
  overflow: visible;
}

.distribution-filterbar {
  position: relative;
  z-index: 5000;
  overflow: visible;
}

.distribution-search-group {
  position: relative;
  z-index: 5001;
  overflow: visible;
}

.distribution-field {
  position: relative;
  overflow: visible;
}

.distribution-field-location {
  position: relative;
  z-index: 6000;
  overflow: visible;
}


#distribution-location-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 99999;
  pointer-events: auto;
}

#distribution-location-panel .distribution-location-columns,
#distribution-location-panel .distribution-location-col,
#distribution-location-panel .distribution-location-list,
#distribution-location-panel .distribution-location-item {
  position: relative;
  z-index: 99999;
  pointer-events: auto;
}

.distribution-body,
.distribution-main,
.distribution-side,
.distribution-panel,
.distribution-panel-body {
  position: relative;
  z-index: 1;
}