h1 { font-family: Arial, Helvetica, sans-serif; }

/* ============================================================
   ★ v1.5.2-B: 견적 편집 화면 반응형 CSS
   (이전에는 app.js innerHTML <style> 안에 있던 것을 정적 파일로 이전)
   ============================================================ */

/* --- 공정 바로가기 패널 (데스크탑) --- */
#est-nav-panel {
  position: sticky;
  top: 0;
  width: 130px;
  flex-shrink: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 0;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  align-self: flex-start;
}
#est-nav-panel .enav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all .15s;
}
#est-nav-panel .enav-item:hover { color: var(--text1); background: var(--bg3); }
#est-nav-panel .enav-item.active {
  color: var(--green);
  font-weight: 700;
  border-left-color: var(--green);
  background: rgba(57,211,83,.07);
}
#est-nav-title {
  font-size: 10px;
  color: var(--text3);
  padding: 4px 12px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: .5px;
}

/* --- 모바일 바로가기 select (기본 숨김) --- */
#est-nav-select-wrap {
  display: none;
  margin-bottom: 10px;
}

/* --- 견적 편집 메인 레이아웃 --- */
#est-editor-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
#est-editor-main {
  flex: 1;
  min-width: 0;
}

/* --- 총괄표 컨테이너 --- */
#est-summary-wrap {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 16px;
  align-self: flex-start;
}
#est-summary-inner {
  overflow-y: auto;
  max-height: calc(100vh - 140px);
  padding-right: 2px;
}

/* --- 항목 행 (b1): 기본 grid 유지, 좁을 때 wrap --- */
.est-item-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: 6px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid rgba(48,54,61,.3);
}
.est-item-name-col { min-width: 120px; }

/* ============================================================
   반응형 breakpoints
   ============================================================ */

/* 900px 이하: 총괄표를 아래로 (b2) */
@media (max-width: 900px) {
  #est-editor-layout {
    flex-direction: column;
  }
  #est-summary-wrap {
    width: 100%;
    position: static;
    top: auto;
  }
  #est-summary-inner {
    max-height: none;
    overflow-y: visible;
  }
}

/* 768px 이하: 바로가기 패널 숨김, 상단 select 노출 (b3) */
@media (max-width: 768px) {
  #est-nav-panel   { display: none !important; }
  #est-nav-select-wrap { display: block !important; }
  /* v1.5.14-C: 월별 도넛 좁은 화면에서 세로 배치 */
  #dash-monthly-donuts { flex-direction: column !important; align-items: center !important; }
}

/* 640px 이하: 항목 행 두 줄 배치 (b1) */
@media (max-width: 640px) {
  .est-item-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }
  /* 이름+설명 컬럼: 1행 전체 */
  .est-item-name-col {
    grid-column: 1 / -1;
    min-width: 0;
  }
  /* 수량·단위·단가·금액·버튼: 2행에 자동 배치 */
}

/* ★ v1.5.26: 견적 목록 칸 제목 줄 ("계약 건 (n)" / "그 외 견적 (m)") */
.est-section-head {
  box-sizing: border-box;
  width: 100%;
  margin: 14px 0 8px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid #9aa7b8;
  background: #eef2f7;
  color: #1f2d3d;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.est-section-head:first-child { margin-top: 2px; }
.est-section-head.est-section-contract { background: #e6f4ea; border-bottom-color: #2e7d32; color: #1b5e20; }
.est-section-head.est-section-other    { background: #eef2f7; border-bottom-color: #8a97a8; color: #37475a; }
@media (max-width: 640px) {
  .est-section-head { margin: 12px 0 6px; padding: 8px 12px; font-size: 13px; }
}
