/* LSMS 공통 스타일 묶음 */

@import url("./outdoor-base.css");
@import url("./outdoor-layout.css");
@import url("./outdoor-components.css");
@import url("./outdoor-mobile.css");

/* === INDOOR/OUTDOOR 공통 사이드바 링크 스타일 === */
.sidebar .nav-link {
  display: block;
  text-decoration: none;
  /* 밑줄 제거 */
  color: inherit;
  /* 부모(.nav-item)의 글자색 그대로 */
}

.sidebar .nav-link:visited {
  color: inherit;
  /* 방문한 링크도 같은 색 */
}

/* === OUTDOOR 계정 관리 전용 보조 스타일 === */
.admin-users-layout {
  align-items: flex-start;
}

.admin-users-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.admin-users-filters input,
.admin-users-filters select {
  min-width: 120px;
  max-width: 180px;
}

.admin-users-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
  margin-right: 4px;
}

.admin-users-pill--primary {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.admin-users-pill--success {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.admin-users-pill--muted {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6b7280;
}

.admin-users-row-selected {
  background: #eff6ff;
}

/* 관리자 전용 사이드바 보조 스타일 */
.nav-item.nav-item-disabled {
  opacity: 0.4;
  cursor: default;
}

/* ===== OUTDOOR 메인 대시보드 v2 ===== */

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.4fr) auto;
  /* LEFT | CENTER(blank) | RIGHT */
  align-items: flex-start;
  column-gap: 32px;
  margin-bottom: 24px;
}

.page-header-left {
  max-width: 640px;
  grid-column: 1 / 3;
  /* LEFT + CENTER 영역을 차지 */
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  line-height: 1.6;
  color: #7b8190;
  margin-bottom: 8px;
}

.page-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 지도 + 상세 패널 메인 레이아웃 */
.outdoor-main-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* 🔧 실내 대시보드 레이아웃 height 고정 */
  height: calc(var(--vh, 1vh) * 100 - 240px);
  /* 페이지 헤더(120px) + KPI 영역(100px) + 여백(20px) */
  max-height: calc(var(--vh, 1vh) * 100 - 240px);
  overflow: hidden;
}

.outdoor-main-left {
  flex: 1 1 auto;
  min-width: 0;
  /* 🔧 내부 스크롤 가능하도록 설정 */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.outdoor-main-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* 🔧 내부 스크롤 가능하도록 설정 */
  overflow-y: auto;
  overflow-x: hidden;
}

/* 공통 컨테이너 통일 (2025-12-31 확장) */
.dashboard-container {
  width: 100%;
  max-width: 1820px;
  /* 1480px -> 1820px 확장 */
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* KPI: 12컬럼 기준 4장 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin: 10px 0 14px;
}

.kpi-grid .kpi-card {
  grid-column: span 3;
}

/* 지도+기상: 9 + 3 */
.main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  /* KPI와 동일 */
  align-items: start;
  /* 🔧 데스크톱에서도 높이 고정 유지 */
  height: calc(var(--vh, 1vh) * 100 - 240px);
  max-height: calc(var(--vh, 1vh) * 100 - 240px);
  overflow: hidden;
}

.main-grid .map-card {
  grid-column: span 9;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-grid .weather-card {
  grid-column: span 3;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

@media (min-width: 1024px) {
  .outdoor-main-row {
    flex-direction: row;
    align-items: stretch;
    /* 🔧 데스크톱에서도 높이 고정 유지 */
    height: calc(var(--vh, 1vh) * 100 - 240px);
    max-height: calc(var(--vh, 1vh) * 100 - 240px);
    overflow: hidden;
  }
}

/* 상단 KPI 카드 */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 14px;
}


.kpi-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
}

.kpi-value {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.kpi-sub {
  font-size: 11px;
  color: #9ca3af;
}

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

@media (max-width: 640px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }
}



/* 메인 패널(지도 / 전도 위험 / 병해충) 토글 */
.main-panel {
  display: none;
}

.main-panel.is-active {
  display: block;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}

.pill-soft {
  background: #f3f5fb;
  color: #4a5ae0;
}

.page-header-right {
  grid-column: 3 / 4;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  /* 요소 간 간격 12~16px 정도로 통일 */
  flex-wrap: wrap;
}

.field-inline {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.field-inline-sm {
  font-size: 11px;
}

.field-label-sm {
  font-size: 11px;
  color: #9197a6;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mw-photos-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 6px;
}

.mw-photos-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mw-photo-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
}

.mw-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mw-photo-delete {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.8);
  color: #f9fafb;
  font-size: 11px;
  cursor: pointer;
}

.select-sm {
  height: 28px;
  padding: 0 28px 0 10px;
  font-size: 12px;
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-primary {
  background: #4a5ae0;
  color: #fff;
  border-radius: 999px;
  border: none;
}

.btn-primary:hover {
  background: #3b47c0;
}

.btn-ghost {
  background: #f5f6fb;
  color: #3c4150;
  border-radius: 999px;
  border: 1px solid #e1e4f0;
}

.btn-ghost:hover {
  background: #e9ecf9;
}

/* ===== 수목 상세 패널 (우측 컬럼: 날씨 아래) ===== */
.details-panel {
  flex: 1 1 auto;
  margin-top: 12px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(var(--vh, 1vh) * 100 - 220px);
  overflow-y: auto;
}

.details-panel.hidden {
  display: none;
}

.details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.details-title {
  font-size: 14px;
  font-weight: 600;
}

.details-close-btn {
  border: none;
  background: transparent;
  font-size: 18px;
  color: #9ca3af;
  cursor: pointer;
}

.details-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 2px;
  min-height: 0;
  /* flex 컨테이너 안에서 제대로 스크롤 생기도록 */
}

.details-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
  font-size: 12px;
}

.details-field label {
  /* 어두운 패널 배경에서도 잘 보이도록 약간 밝은 회색 사용 */
  color: #9ca3af;
}

.details-field span {
  /* 상세 패널 본문 텍스트는 밝은 회색으로 */
  color: #e5e7eb;
}

.details-field-memo span {
  white-space: pre-wrap;
}

.details-input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 4px 8px;
  font-size: 12px;
}

.details-input.hidden {
  display: none;
}

.details-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.details-danger {
  color: #b91c1c;
}

.hidden {
  display: none !important;
}

.details-hint {
  margin-top: 4px;
  font-size: 11px;
  color: #059669;
}

/* 위험요인 분석 카드 */
.risk-card {
  margin-top: 10px;
  padding: 10px 10px 8px;
  border-radius: 10px;
  background: #0f172a;
  color: #e5e7eb;
}

.risk-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.risk-card-title {
  font-size: 13px;
  font-weight: 600;
}

.risk-card-sub {
  font-size: 11px;
  color: #9ca3af;
}

.risk-card-score {
  font-size: 14px;
  font-weight: 700;
  color: #facc15;
}

.risk-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.risk-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
}

.risk-chip-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.risk-chip-main {
  flex: 1;
  min-width: 0;
}

.risk-chip-label {
  font-size: 11px;
  font-weight: 600;
}

/* ===== OUTDOOR: 기상 카드 레이아웃(제목/뱃지 + 7일 예보 행) ===== */

.weather-card .weather-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weather-card .weather-card__header .badge,
.weather-card .weather-card__header .weather-badge {
  white-space: nowrap;
  flex: 0 0 auto;
}

.weather-card .weather-card__header .title,
.weather-card .weather-card__header h3 {
  margin: 0;
  line-height: 1.2;
}

.weather-card .weather-card__forecast .weather-row {
  display: grid;
  grid-template-columns: 84px 60px 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 8px 10px;
}

.weather-card .weather-row .weather-col--date {
  line-height: 1.2;
}

.weather-card .weather-row .weather-col--state {
  text-align: left;
  white-space: nowrap;
}

.weather-card .weather-row .weather-col--tempwind {
  text-align: right;
  white-space: nowrap;
}

.risk-chip-desc {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.risk-chip-score {
  font-size: 12px;
  font-weight: 600;
  color: #facc15;
}

/* ===== 공통 모달 (새 수목 등록 등) ===== */
.lsms-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* hidden 속성이 있을 때는 어떤 경우에도 보이지 않도록 강제 숨김 */
.lsms-modal-backdrop[hidden] {
  display: none !important;
}

.lsms-modal {
  width: 520px;
  max-width: 90vw;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  padding: 18px 20px 16px;
}

.lsms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lsms-modal-title {
  font-size: 18px;
  margin: 0;
}

.lsms-modal-close {
  border: none;
  background: transparent;
  font-size: 20px;
  color: #9ca3af;
  cursor: pointer;
}

.lsms-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lsms-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.lsms-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.lsms-modal-help {
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
}

.map-shell {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  padding: 18px 20px 18px 20px;
  /* 🔧 실내 대시보드 지도 영역 높이 고정 */
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-shell-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
  /* 🔧 헤더는 고정 높이 */
  flex-shrink: 0;
}

.map-shell-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.map-shell-subtitle {
  font-size: 12px;
  color: #7b8190;
}

.map-shell-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-shell-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  min-height: 520px;
  /* 🔧 실내 대시보드 지도 본문 영역 스크롤 설정 */
  flex: 1;
  overflow: hidden;
}

.map-filter-panel {
  background: #f7f8fd;
  border-radius: 12px;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-filter-section {
  border-bottom: 1px solid #e1e4f0;
  padding-bottom: 10px;
  margin-bottom: 6px;
}

.map-filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.map-filter-title {
  font-size: 12px;
  font-weight: 600;
  color: #383f4f;
  margin-bottom: 6px;
}

.pill-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pill-toggle {
  border-radius: 999px;
  border: 1px solid #dadff0;
  background: #ffffff;
  font-size: 11px;
  padding: 6px 10px;
  text-align: left;
  cursor: pointer;
}

.pill-toggle.is-active {
  border-color: #4a5ae0;
  background: #eef0ff;
  color: #2832b0;
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.legend-checkbox {
  width: 12px;
  height: 12px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.legend-high {
  background: #ff4b5c;
}

.legend-mid {
  background: #ffb648;
}

.legend-low {
  background: #35c46b;
}

.legend-label {
  color: #555d6e;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #555d6e;
}

.map-area {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #e5e7f0;
  /* 🔧 실내 대시보드 지도 영역 높이 고정 및 스크롤 */
  height: 100%;
  max-height: 100%;
}

.map-canvas {
  width: 100%;
  height: 100%;
  min-height: 480px;
}

.map-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(6px);
}

.map-provider-label {
  font-size: 11px;
  color: #6b7280;
  padding-right: 8px;
  border-right: 1px solid #e2e5f0;
}

.map-toolbar-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 존(구역) 필터 배지 */
.zone-filter-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 11px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.45);
  z-index: 550;
}

.zone-filter-label {
  opacity: 0.8;
}

.zone-filter-clear-btn {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 2px;
  font-size: 14px;
}

/* ===== 존(구역) 생성 플로팅 패널 ===== */
.zone-editor-panel {
  position: absolute;
  top: 70px;
  right: 20px;
  width: 260px;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
  padding: 10px 12px 10px;
  z-index: 560;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zone-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.zone-editor-title {
  font-size: 13px;
  font-weight: 600;
}

.zone-editor-close {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 16px;
}

.zone-editor-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
}

.zone-editor-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zone-editor-label {
  color: #9ca3af;
}

.zone-editor-input {
  border-radius: 8px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 12px;
  padding: 4px 8px;
}

.zone-editor-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zone-color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
}

.zone-color-swatch[data-color="#22c55e"] {
  background: #22c55e;
}

.zone-color-swatch[data-color="#16a34a"] {
  background: #16a34a;
}

.zone-color-swatch[data-color="#3b82f6"] {
  background: #3b82f6;
}

.zone-color-swatch[data-color="#0ea5e9"] {
  background: #0ea5e9;
}

.zone-color-swatch[data-color="#f97316"] {
  background: #f97316;
}

.zone-color-swatch[data-color="#facc15"] {
  background: #facc15;
}

.zone-color-swatch[data-color="#a855f7"] {
  background: #a855f7;
}

.zone-color-swatch[data-color="#6b7280"] {
  background: #6b7280;
}

.zone-color-swatch.is-selected {
  border-color: #e5e7eb;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.zone-editor-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

/* ===== 토스트 ===== */
.outdoor-toast-container {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.outdoor-toast {
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.outdoor-toast.is-hide {
  opacity: 0;
  transform: translateY(-6px);
}

/* ===== 수목 미니 요약 툴팁 (마커 hover / 탭) ===== */
.tree-mini-tooltip {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 8px;
  color: #e5e7eb;
  padding: 6px 8px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.5);
  border: none;
  font-size: 11px;
}

.tree-mini-tooltip .leaflet-tooltip-arrow {
  display: none;
}

.tree-mini-tooltip-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tree-mini-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tree-mini-title .id {
  font-weight: 600;
  font-size: 12px;
}

.tree-mini-title .species {
  font-size: 11px;
  color: #9ca3af;
}

.tree-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tree-mini-row .label {
  font-size: 11px;
  color: #9ca3af;
}

.tree-mini-row .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tree-mini-row .level {
  font-weight: 600;
  font-size: 11px;
}

.tree-mini-row .level-HIGH {
  color: #fca5a5;
}

.tree-mini-row .level-MID {
  color: #fed7aa;
}

.tree-mini-row .level-LOW {
  color: #bbf7d0;
}

.tree-mini-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.6);
}

.tree-mini-note {
  margin-top: 2px;
  font-size: 11px;
  color: #facc15;
}

/* 기상 예보 목록 온도 강조 */
.wf-temp {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.wf-temp-min {
  font-weight: 700;
  color: #0f172a;
}

.wf-temp-max {
  font-weight: 500;
  color: #4b5563;
}

/* ===== 수목 상세 패널 · 최근 점검 이력 ===== */
.details-history {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.details-history-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #e5e7eb;
}

.details-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.details-history-item {
  font-size: 11px;
  color: #cbd5f5;
}

.details-history-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.details-history-item-meta .date {
  font-weight: 600;
}

.details-history-item-meta .user {
  opacity: 0.85;
}

.details-history-item-memo {
  margin-left: 8px;
  color: #9ca3af;
}

.details-history-empty {
  font-size: 11px;
  color: #9ca3af;
}

/* RFID / QR 코드 */
.details-qr {
  display: flex;
  align-items: center;
  gap: 8px;
}

.details-qr-preview {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.details-qr-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== OUTDOOR: 기상 카드 레이아웃 강제 (data-testid 기반) ===== */

[data-testid="weather-card"] {
  overflow: hidden;
  box-sizing: border-box;
}

[data-testid="weather-card"] .weather-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

[data-testid="weather-card"] .weather-badge {
  white-space: nowrap !important;
  flex: 0 0 auto !important;
}

/* (2025-12-31) weather 예보 리스트 강제 스크롤 제거 – 카드 전체 높이 안에서 자연스럽게 확장 */
[data-testid="weather-card"] .weather-card__forecast,
[data-testid="weather-card"] .weather-forecast,
[data-testid="weather-card"] .forecast-list {
  overflow: visible;
}

[data-testid="weather-card"] .forecast-row {
  display: grid !important;
  grid-template-columns: 120px 1fr 160px !important;
  align-items: center !important;
  column-gap: 12px !important;
  padding: 10px 12px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  line-height: 1.45 !important;
  overflow: hidden !important;
  /* 넘침 방지 */
}

[data-testid="weather-card"] .forecast-row>*:nth-child(1) {
  justify-self: start;
}

[data-testid="weather-card"] .forecast-row>*:nth-child(2) {
  justify-self: center;
  color: #6b7280;
}

[data-testid="weather-card"] .forecast-row>*:nth-child(3) {
  justify-self: end;
  text-align: right;
}

[data-testid="weather-card"] .forecast-row>* {
  min-width: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

[data-testid="weather-card"] .forecast-temp {
  text-align: right !important;
  white-space: nowrap !important;
  /* 줄바꿈 금지(한 줄 유지) */
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  line-height: 1.2 !important;
}

[data-testid="weather-card"] .forecast-temp .temp-line {
  white-space: nowrap !important;
  /* 최저/최고는 한 줄 유지 */
  font-weight: 600;
}

[data-testid="weather-card"] .forecast-temp .wind-line {
  white-space: nowrap !important;
  opacity: 0.8;
  font-size: 12px;
}

@media (max-width: 480px) {
  [data-testid="weather-card"] .forecast-row {
    grid-template-columns: 72px 56px minmax(0, 1fr) !important;
    column-gap: 8px !important;
    padding: 8px 8px !important;
  }

  [data-testid="weather-card"] .forecast-temp {
    font-size: 12px !important;
  }
}

/* ===== OUTDOOR: weather 카드 비주얼 톤 정리 ===== */
/* (2025-12-31) 카드 자체는 공통 .card 규칙 그대로 사용 – padding/border/shadow는 .card 기준 유지 */

/* 헤더 타이포 리듬 정리 */
[data-testid="weather-card"] .weather-card-header,
[data-testid="weather-card"] .weather-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 12px;
}

[data-testid="weather-card"] .weather-title {
  font-size: 13px;
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

[data-testid="weather-card"] .weather-sub {
  margin: 0 0 12px 0;
  line-height: 1.5;
}

[data-testid="weather-card"] .weather-badge-today {
  font-size: 10px;
  padding: 2px 8px;
}

/* 내부 today 박스를 섹션 톤으로 약화 (카드 안 카드 느낌 제거) */
[data-testid="weather-card"] .weather-today {
  display: flex !important;
  align-items: flex-start !important;
  gap: 16px !important;
  margin-top: 6px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid rgba(209, 213, 219, 0.7);
  box-shadow: none;
}

[data-testid="weather-card"] .weather-today-main {
  font-size: 18px;
  line-height: 1.15;
  margin: 0 0 6px 0;
}

[data-testid="weather-card"] .weather-today-meta,
[data-testid="weather-card"] .weather-today-extra {
  margin: 0;
  line-height: 1.45;
}

/* 7일 예보 박스도 섹션 느낌으로 정리 */
[data-testid="weather-card"] .weather-forecast-title {
  margin-top: 10px;
  margin-bottom: 8px;
}

[data-testid="weather-card"] .weather-card__forecast {
  border-radius: 8px;
  border: 1px solid rgba(209, 213, 219, 0.7);
  background: #f9fafb;
  padding: 4px 8px;
  box-shadow: none;
}

/* 지도 위 수목 상세 오버레이 패널 */
.tree-overlay-panel {
  position: absolute;
  right: 20px;
  top: 80px;
  bottom: 20px;
  /* map-area 안에서 위·아래 여백만 두고 꽉 차게 */
  width: 360px;
  max-width: 40vw;
  max-height: none;
  /* 높이는 top/bottom으로 결정 */
  background: #0b1220;
  color: #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.55);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  /* 헤더는 고정, 내부 .details-body만 스크롤하도록 오버레이 자체는 클리핑만 수행 */
  overflow: hidden;
  z-index: 600;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  /* 패널 안에서 스크롤할 때 바깥(지도)로 이벤트 전파 방지 */
  overscroll-behavior: contain;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.tree-overlay-panel.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.tree-overlay-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tree-overlay-panel .details-close-btn {
  margin-left: auto;
  cursor: pointer;
}

@media (max-width: 1023px) {
  .tree-overlay-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 18px 18px 0 0;
    margin: 0 auto;
  }
}

.btn-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: #f3f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-icon:hover {
  background: #e5e7ff;
}

.btn-icon .material-symbols-rounded {
  font-size: 16px;
}

.btn-icon.is-active {
  background: #111827;
  color: #f9fafb;
}

/* 박스 선택 / 편집 모드 툴바 아이콘 보조 스타일 */
.btn-icon[data-mode-toggle="true"] {
  border-radius: 999px;
}

.lsms-marker {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.lsms-marker--high {
  background: radial-gradient(circle at 30% 20%, #ff9a9e, #ff4b5c);
}

.lsms-marker--mid {
  background: radial-gradient(circle at 30% 20%, #ffd991, #ffb648);
}

.lsms-marker--low {
  background: radial-gradient(circle at 30% 20%, #9ee7c2, #35c46b);
}

.blink {
  animation: blinker 1s linear infinite;
}

/* 박스 선택으로 선택된 수목 마커 하이라이트 */
.lsms-marker-wrapper.is-selected .lsms-marker {
  box-shadow: 0 0 0 3px #facc15, 0 0 0 6px rgba(250, 204, 21, 0.45);
}

@keyframes blinker {
  50% {
    opacity: 0.3;
  }
}

/* Leaflet 마커 클러스터 */
.lsms-cluster-wrapper {
  /* 기본 MarkerCluster 스타일을 덮어쓰기 위한 래퍼 */
}

.lsms-cluster {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.lsms-cluster span {
  transform: translateY(1px);
}

.lsms-cluster--high {
  background: radial-gradient(circle at 30% 20%, #fecaca, #dc2626);
}

.lsms-cluster--mid {
  background: radial-gradient(circle at 30% 20%, #fef3c7, #f59e0b);
}

.lsms-cluster--low {
  background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
}

/* ===== 오늘 우선 점검 대상 TOP5 카드 ===== */
.top-risk-card {
  margin-top: 16px;
}

.top-risk-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.top-risk-item {
  display: grid;
  grid-template-columns: 20px 1fr 1fr 50px;
  align-items: center;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #0f172a;
  color: #e5e7eb;
}

.top-risk-item .rank {
  font-weight: 700;
  color: #facc15;
}

.top-risk-item .id {
  font-weight: 600;
}

.top-risk-item .species {
  color: #cbd5f5;
}

.top-risk-item .score {
  justify-self: flex-end;
  font-weight: 600;
}

.top-risk-empty {
  font-size: 12px;
  color: #9ca3af;
}

/* 통합 관리자 탭 & iframe */
.admin-tabs {
  display: inline-flex;
  gap: 6px;
  margin: 8px 0 10px;
}

.admin-tab {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
}

.admin-tab.is-active {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.admin-iframe-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  height: 68vh;
}

.admin-iframe-wrap iframe {
  width: 100%;
  height: 100%;
}

/* 위험도 요인 분석 모달 */
.risk-explain-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.risk-explain-title {
  font-size: 15px;
  font-weight: 600;
}

.risk-explain-sub {
  font-size: 12px;
  color: #9ca3af;
}

.risk-explain-score {
  font-size: 18px;
  font-weight: 700;
  color: #facc15;
}

.risk-explain-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
}

.risk-explain-section-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #e5e7eb;
}

.risk-explain-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.risk-explain-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.risk-explain-item span:last-child {
  font-weight: 600;
}

/* ===== INDOOR 식물 관리 카드 그리드 ===== */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chip {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 4px 10px;
  font-size: 12px;
  background: #f9fafb;
  cursor: pointer;
  color: #374151;
}

.chip:hover {
  background: #eef2ff;
  border-color: #c4c9ff;
}

.chip.chip--filled {
  background: #111827;
  color: #f9fafb;
  border-color: #111827;
}

.plant-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.plant-card-item {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  position: relative;
}

.plant-card-thumb {
  width: 100%;
  height: 90px;
  aspect-ratio: 16 / 9;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plant-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 11px;
  background: #0b1120;
}

.plant-card-thumb-placeholder .material-symbols-rounded {
  font-size: 24px;
  margin-bottom: 2px;
}

.plant-card-thumb-text {
  font-size: 11px;
}

.plant-card-main {
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plant-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plant-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plant-card-id {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
}

.plant-card-menu-btn {
  border: none;
  background: transparent;
  padding: 2px;
  border-radius: 999px;
  cursor: pointer;
  color: #9ca3af;
}

.plant-card-menu-btn:hover {
  background: #f3f4f6;
  color: #4b5563;
}

.plant-card-name {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plant-card-type-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
}

.plant-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #6b7280;
}

.plant-card-meta-row {
  display: flex;
  gap: 4px;
}

.plant-card-footer {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.plant-card-menu {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 140px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.25);
  border: 1px solid #e5e7eb;
  padding: 4px 0;
  z-index: 40;
}

.plant-card-menu-item {
  width: 100%;
  text-align: left;
  padding: 6px 10px;
  font-size: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.plant-card-menu-item:hover {
  background: #f3f4ff;
}

.plant-card-menu-item.is-danger {
  color: #b91c1c;
}

.plant-card-menu-item.is-disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

.form-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #374151;
}

.form-required {
  color: #dc2626;
  margin-left: 2px;
}

.input-text {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  box-sizing: border-box;
}

.input-text:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.25);
}

.form-help {
  margin-top: 2px;
  font-size: 11px;
  color: #6b7280;
}

.plant-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.plant-detail-row {
  display: flex;
  gap: 6px;
}

.plant-detail-row .label {
  width: 80px;
  color: #6b7280;
}

.plant-detail-row .value {
  flex: 1;
  color: #111827;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.asset-card {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 8px 10px 10px;
  background: #ffffff;
}

.asset-card-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.asset-card-body {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.asset-empty {
  font-size: 12px;
  color: #9ca3af;
}

.btn.btn-sm.is-danger {
  background: #dc2626;
  color: #ffffff;
  border-radius: 999px;
  border: none;
}

.btn.btn-sm.is-danger:hover {
  background: #b91c1c;
}

/* plant detail 레이아웃: 이미지 타일 비중 확대 */
.plant-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr);
  gap: 16px;
  align-items: flex-start;
}

/* INDOOR schedule 달력 */
.schedule-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  font-size: 11px;
}

.schedule-calendar-header {
  text-align: center;
  font-weight: 600;
  color: #9ca3af;
  padding: 4px 0;
}

.schedule-calendar-day {
  border-radius: 8px;
  padding: 4px 6px;
  min-height: 48px;
  background: #020617;
  border: 1px solid #1f2937;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-calendar-day.is-other-month {
  opacity: 0.4;
  cursor: default;
}

.schedule-calendar-day.is-selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

.schedule-day-number {
  font-weight: 600;
  color: #e5e7eb;
  font-size: 12px;
}

.schedule-task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.schedule-task-badge {
  padding: 1px 4px;
  border-radius: 999px;
  background: #111827;
  color: #9ca3af;
  font-size: 9px;
}

.schedule-task-badge.is-main {
  background: #3b82f6;
  color: #e5e7eb;
}

/* 작업기록 모달 사진 미리보기 */
.worklog-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.worklog-photo-item {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #1f2937;
  position: relative;
}

.worklog-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.worklog-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #f97373;
  font-size: 11px;
  padding: 0 4px;
  cursor: pointer;
}

.worklog-detail-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
}

.risk-explain-item-empty {
  font-size: 12px;
  color: #9ca3af;
}

.risk-explain-footer {
  margin-top: 6px;
  font-size: 12px;
  color: #e5e7eb;
}

.tree-popup {
  min-width: 260px;
  max-width: 320px;
  font-size: 12px;
  color: #111827;
}

.tree-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.tree-popup-id {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
}

.tree-popup-name {
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
  margin-bottom: 2px;
}

.tree-popup-meta {
  font-size: 11px;
  color: #9ca3af;
}

.tree-popup-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.tree-popup-badge--good {
  background: #e3f7eb;
  color: #148f4d;
}

.tree-popup-badge--warn {
  background: #fff3d7;
  color: #b36900;
}

.tree-popup-badge--bad {
  background: #ffe1e3;
  color: #c0303b;
}

.tree-popup-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  overflow-x: auto;
}

.tree-popup-tab {
  flex-shrink: 0;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  background: #f3f4f6;
  cursor: pointer;
}

.tree-popup-tab.is-active {
  background: #eef0ff;
  color: #2832b0;
}

.tree-popup-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 6px;
}

.tree-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.tree-popup-row-label {
  color: #6b7280;
}

.tree-popup-row-value {
  font-weight: 500;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {

  /* 1. Global Overflow & Container */
  body,
  html {
    overflow-x: hidden;
  }

  .dashboard-container {
    padding: 0 16px;
    /* Reduce padding on mobile */
    width: 100%;
    max-width: 100%;
  }

  /* 2. Sidebar & Main Layout */
  .sidebar {
    display: none;
    /* Hide sidebar */
  }

  main {
    margin-left: 0 !important;
    width: 100% !important;
  }

  /* 3. Page Header Reflow */
  .page-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
  }

  .page-header-left {
    max-width: 100%;
    grid-column: auto;
  }

  .page-header-right {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
    width: 100%;
    grid-column: auto;
  }

  /* 4. KPI Grid Stacking (2 columns default) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .kpi-grid .kpi-card {
    grid-column: span 1 !important;
  }

  /* 5. Main Grid Stacking (1 column) */
  .main-grid {
    display: flex;
    flex-direction: column;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    gap: 16px;
  }

  .main-grid .map-card,
  .main-grid .weather-card {
    width: 100%;
    grid-column: auto;
    height: auto !important;
    min-height: 400px;
    overflow: visible !important;
  }

  /* 6. Text Overflow Protection */
  .card,
  .weather-card,
  .kpi-card {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word;
  }

  [data-testid="weather-card"] .forecast-row {
    height: auto !important;
  }

  [data-testid="weather-card"] .forecast-row>* {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  /* 7. Map Visibility Fix */
  .map-shell-body {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    min-height: auto !important;
  }

  .map-filter-panel {
    display: none !important;
    /* Hide filter panel */
  }

  .map-area {
    width: 100% !important;
    height: 55vh !important;
    /* Force height */
    min-height: 400px !important;
    flex: 0 0 auto !important;
  }

  .map-canvas {
    height: 100% !important;
  }

  /* 8. Weather Badge Overflow Fix (Mobile) */
  [data-testid="weather-card"] {
    overflow: hidden;
  }

  [data-testid="weather-card"] .weather-card-header,
  [data-testid="weather-card"] .weather-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }

  [data-testid="weather-card"] .weather-title,
  [data-testid="weather-card"] h3,
  [data-testid="weather-card"] .card-title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  [data-testid="weather-card"] .badge,
  [data-testid="weather-card"] .pill,
  [data-testid="weather-card"] .weather-badge {
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 9. Mobile Sidebar (Off-canvas) */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    /* iOS Safari 100vh 버그 수정 */
    height: calc(var(--vh, 1vh) * 100);
    width: 260px !important;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 9999;
    display: block !important;
    /* Force display for animation */
    background: #020617 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body.sidebar-open .sidebar,
  .sidebar.sidebar-open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.5);
  }
  
  /* 모바일에서 사이드바가 열렸을 때 모든 메뉴 항목 표시 */
  body.sidebar-open .sidebar .side-title,
  .sidebar.sidebar-open .side-title,
  body.sidebar-open .sidebar .side-section-label,
  .sidebar.sidebar-open .side-section-label,
  body.sidebar-open .sidebar .nav-label-wrap,
  .sidebar.sidebar-open .nav-label-wrap,
  body.sidebar-open .sidebar .side-footer,
  .sidebar.sidebar-open .side-footer {
    display: block !important;
  }
  
  body.sidebar-open .sidebar .nav-label-wrap,
  .sidebar.sidebar-open .nav-label-wrap {
    display: flex !important;
  }

  /* Mobile Menu Button */
  .mobile-menu-btn {
    display: block;
    /* Show hamburger on mobile */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-right: 8px;
    padding: 0;
  }

  /* Mobile Overlay */
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: none;
  }

  body.sidebar-open .mobile-overlay {
    display: block;
  }
}

/* Extra Small Mobile (<= 480px) */
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }

  .page-title {
    font-size: 20px;
  }

  .kpi-value {
    font-size: 16px;
  }
}