/* NK 기술인 관리 시스템 - 기본 스타일 (외부 CDN 없이 완전 오프라인 동작) */
:root {
  --color-bg: #f4f6f8;
  --color-surface: #ffffff;
  --color-border: #dfe3e8;
  --color-text: #1f2933;
  --color-text-dim: #616e7c;
  --color-primary: #2f6fed;
  --color-primary-dark: #1d54c7;
  --color-danger: #e5484d;
  --color-danger-bg: #fdecec;
  --color-success: #1a8754;
  --color-success-bg: #e8f6ee;
  --color-warning: #9a6700;
  --color-warning-bg: #fff6e0;
  --color-info: #0b6e99;
  --color-info-bg: #e6f4fa;
  --radius: 8px;
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}
body {
  margin: 0;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
  background: #14213d;
  color: #fff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.navbar .brand { font-weight: 700; font-size: 18px; color: #fff; }
.navbar .nav-links { display: flex; gap: 18px; align-items: center; }
.navbar .nav-links a { color: #cdd6e5; }
.navbar .nav-links a:hover { color: #fff; }
.navbar .user-badge {
  background: rgba(255,255,255,0.12);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
}
.nav-dropdown { position: relative; }
.nav-dropdown > button {
  background: none;
  border: none;
  color: #cdd6e5;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-dropdown > button:hover { color: #fff; }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  /* 상위 탭과 메뉴 사이에 마우스가 빠지는 틈이 없도록 바로 붙입니다. */
  margin-top: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 33, 61, 0.25);
  min-width: 200px;
  padding: 6px;
  z-index: 250;
}
.nav-dropdown-menu[hidden] { display: none; }
/* 화면 왼쪽 편의 드롭다운(입찰/개발·투자·활용)은 오른쪽 정렬(right:0)로 두면 화면
   밖으로 넘어가버려서 왼쪽 정렬로 둡니다 (오른쪽 끝의 "관리자" 드롭다운만 그대로 유지). */
#announcement-nav-menu, #bid-nav-menu, #company-nav-menu, #perf-nav-menu, #div-nav-menu { left: 0; right: auto; }
.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  color: #14213d;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 14px;
}
.nav-dropdown-menu a:hover { background: rgba(20, 33, 61, 0.08); color: #14213d; }
.navbar .admin-badge {
  background: #ffb020;
  color: #1f2933;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
}

/* ---- 열어본 탭 표시 바 (최상단 메뉴 바로 아래, 스크롤해도 고정) ---- */
.open-tabs-bar {
  position: sticky;
  top: 56px;
  z-index: 190;
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 6px 16px;
  background: #eef1f6;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  white-space: nowrap;
}
.open-tabs-bar:empty { display: none; }
.open-tabs-bar .open-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px 6px 0 0;
  padding: 5px 8px 5px 12px;
  font-size: 12.5px;
  color: var(--color-text-dim, #556);
  cursor: pointer;
  max-width: 200px;
  flex: 0 0 auto;
}
.open-tabs-bar .open-tab:hover { background: #f4f6fa; }
.open-tabs-bar .open-tab.active {
  background: #fff;
  color: #14213d;
  font-weight: 600;
  border-bottom: 2px solid #14213d;
}
.open-tabs-bar .open-tab .open-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.open-tabs-bar .open-tab .open-tab-close {
  border: none;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.open-tabs-bar .open-tab .open-tab-close:hover { opacity: 1; }
.open-tabs-bar .open-tabs-close-all {
  flex: none;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #fff;
  color: var(--color-text-dim);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.open-tabs-bar .open-tabs-close-all:hover { background: #f4f6fa; color: #14213d; }

.container {
  max-width: 1800px;
  margin: 0 auto;
  padding: 24px 32px;
}
.container-wide {
  max-width: none;
  padding-left: 32px;
  padding-right: 32px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.card h2, .card h3 { margin-top: 0; }
.card > h2:first-child,
.card > h2.card-title {
  text-align: center;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px dashed var(--color-border);
}

h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; color: var(--color-text-dim); text-transform: uppercase; letter-spacing: .04em; }

.flash-list { margin-bottom: 16px; }
.flash {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
}
.flash-success { background: var(--color-success-bg); color: var(--color-success); }
.flash-danger  { background: var(--color-danger-bg); color: var(--color-danger); }
.flash-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.flash-info    { background: var(--color-info-bg); color: var(--color-info); }

.lock-banner {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid #f5b5b7;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 600;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: center; padding: 8px 10px; border-bottom: 1px solid var(--color-border); border-right: 1px solid var(--color-border); font-size: 14px; }
th:last-child, td:last-child { border-right: none; }
th { color: var(--color-text); font-weight: 700; background: #ABF1FF; }
tbody tr:nth-child(even) td { background: #f6f8fc; }
tr:hover td { background: #eef3ff; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}
.btn:hover { background: #f1f4f8; text-decoration: none; }
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-danger { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.form-group { margin-bottom: 14px; }
label { display: block; font-size: 13px; color: var(--color-text-dim); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}
input[type=checkbox] { width: auto; margin-right: 6px; }

.row-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

.subtable-row td { vertical-align: top; padding: 6px; }
.subtable td input { min-width: 100px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }

.engineer-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--color-border); margin-bottom: 16px; }
.engineer-tabs .tab {
  padding: 8px 18px;
  border-radius: 8px 8px 0 0;
  color: var(--color-text-dim);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
}
.engineer-tabs .tab:hover { background: #f1f4f8; text-decoration: none; }
.engineer-tabs .tab.active {
  background: var(--color-surface);
  border-color: var(--color-border);
  border-bottom-color: var(--color-surface);
  color: var(--color-primary);
  margin-bottom: -2px;
}
.search-box { display: flex; gap: 8px; }
.search-box input { min-width: 220px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.badge-locked { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-open { background: var(--color-success-bg); color: var(--color-success); }

.muted { color: var(--color-text-dim); font-size: 13px; }
.add-row-btn { margin-top: 8px; }
.section-divider { border: none; border-top: 1px solid var(--color-border); margin: 20px 0; }

body.login-page {
  background: url("../img/login-bg.jpg") no-repeat center center fixed;
  background-size: 100% 100%;
  min-height: 100vh;
}
.login-wrap {
  max-width: 380px;
  margin: 80px auto;
}
.login-wrap .card {
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 36px rgba(20, 33, 61, 0.28);
}
.login-wrap h1 { margin-bottom: 20px; }
.login-wrap p.muted { margin-top: 0; margin-bottom: 20px; }

/* 다중 선택 필터 (체크박스 드롭다운) */
.multi-select {
  position: relative;
}
.multi-select summary {
  cursor: pointer;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--color-surface);
  list-style: none;
  user-select: none;
}
.multi-select summary::-webkit-details-marker { display: none; }
.multi-select summary::after { content: "▾"; float: right; color: var(--color-text-dim); }
.multi-select[open] summary::after { content: "▴"; }
.multi-select .multi-select-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  max-height: 260px;
  overflow: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  padding: 8px;
}
.multi-select .multi-select-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text);
  padding: 4px 2px;
  margin: 0;
  cursor: pointer;
}
.multi-select .multi-select-panel input[type=checkbox] { width: auto; margin: 0; }
.multi-select .multi-select-actions {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 6px;
  padding-bottom: 6px;
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}
.multi-select .multi-select-actions a { font-size: 12px; }
.range-pair { display: flex; gap: 6px; align-items: center; }
.range-pair input { width: 100%; }

/* 크기 조절/고정 헤더 테이블 */
.resizable-table-wrap {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
table.resizable-table {
  table-layout: fixed;
  width: 100%;
}
table.resizable-table th, table.resizable-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
table.resizable-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #ABF1FF;
}
/* 자동으로 너비 조절을 붙인 일반 표: 모양은 그대로, 폭만 고정 */
table.col-resizable { table-layout: fixed; }
table.col-resizable thead th { position: relative; overflow-wrap: anywhere; }
table.col-resizable td { overflow-wrap: anywhere; }
table.col-resizable th .col-resize-handle,
table.resizable-table th .col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}
table.resizable-table th .col-resize-handle:hover,
table.resizable-table th .col-resize-handle.resizing,
table.col-resizable th .col-resize-handle:hover,
table.col-resizable th .col-resize-handle.resizing {
  background: var(--color-primary);
  opacity: 0.4;
}
/* Ctrl+클릭으로 고른 컬럼(함께 너비 조절) */
table.resizable-table thead th.col-selected,
table.col-resizable thead th.col-selected {
  background: #ffe08a;
  box-shadow: inset 0 -3px 0 var(--color-primary);
}
/* 머리글 오른쪽 클릭 메뉴(컬럼 너비 맞춤) */
.col-width-menu {
  position: fixed; z-index: 2000; min-width: 190px; padding: 4px;
  background: #fff; border: 1px solid var(--color-border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(23, 43, 77, .18); display: flex; flex-direction: column;
}
.col-width-menu button {
  border: 0; background: none; text-align: left; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.col-width-menu button:hover { background: #eef3fb; }
.col-width-menu-hint { font-size: 11px; color: var(--color-muted, #61758a); padding: 6px 12px 4px; border-top: 1px solid var(--color-border); margin-top: 4px; }

/* 팝업(모달) - 계약 화면의 참여자명단 추가 팝업 등에서 사용.
   화면 정중앙에 뜨고, 네모박스(.modal-box) 바깥 왼쪽 위에 .modal-dialog-title로
   제목을 따로 둡니다: <div class="modal-overlay"><div class="modal-dialog">
   <h3 class="modal-dialog-title">제목</h3><div class="modal-box">...내용...</div>
   </div></div> */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 33, 61, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  /* 상단 메뉴바(z-index 200)/열어본 탭 바(z-index 190)보다 항상 위에 떠야, 긴
     팝업이 열렸을 때 위쪽이 메뉴바에 가려지지 않고 40px 여유가 실제로 보입니다. */
  z-index: 300;
  overflow: auto;
}
.modal-overlay[hidden] { display: none; }
.modal-dialog {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 520px;
  margin: auto;
}
.modal-dialog-wide { max-width: 1100px; }
.modal-dialog-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 6px 6px 6px 10px;
  background: #fff;
  border-radius: var(--radius);
}
.modal-dialog-title {
  margin: 0;
  color: #14213d;
  font-size: 20px;
  font-weight: 700;
}
.modal-close-btn {
  flex: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  color: var(--color-text);
  border-radius: var(--radius);
}
.modal-close-btn:hover { background: rgba(20, 33, 61, 0.08); color: #14213d; }
.modal-box {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  overflow-x: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,0.24);
}

/* 조회 전용 팝업/카드에서 "라벨 + 값" 하나하나를 파스텔톤 박스로 구분해서 보여줄 때
   씁니다 (글씨만 쭉 나오면 항목 경계가 헷갈린다는 피드백으로 추가함). */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.detail-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(20, 33, 61, 0.06);
}
.detail-item > .muted { display: block; font-size: 12px; margin-bottom: 4px; }
.detail-item:nth-child(6n+1) { background: #eaf2ff; }
.detail-item:nth-child(6n+2) { background: #eafaf0; }
.detail-item:nth-child(6n+3) { background: #fff7e0; }
.detail-item:nth-child(6n+4) { background: #fdeaf3; }
.detail-item:nth-child(6n+5) { background: #f1eaff; }
.detail-item:nth-child(6n+6) { background: #eafcfc; }

/* 자동 계산되어 표시만 되는 값 (계약 화면의 잔여금액 등) */
.calc-display {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #f4f6f8;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

/* 전체계약/차수별계약 영역 구분 (파스텔톤) */
.phase-block {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}
.phase-block[data-is-base="1"] {
  background: #eaf1ff;       /* 파스텔 블루 - 전체계약 */
  border-color: #c7dbff;
}
.phase-block[data-is-base="0"] {
  background: #eafbf3;       /* 파스텔 민트 - 차수별계약 */
  border-color: #c3ecd8;
}

/* 변경계약/과업중지/청구내역: 해당 항목을 추가했을 때만 표시 */
.amend-section[hidden],
.susp-section[hidden],
.bill-section[hidden] {
  display: none;
}

/* 첨부파일: "첨부"(숨긴 file input을 감싼 라벨) + "열람"(파일명/수정일자/수정자 패널 토글) */
.file-attach-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.file-attach-label {
  cursor: pointer;
  margin: 0;
}
.file-selected-name {
  font-size: 12px;
}
.file-meta-panel {
  flex-basis: 100%;
  margin-top: 2px;
}
.file-meta-panel[hidden] {
  display: none;
}

/* ---- HWPX 양식 매핑 팝업 (기술인 실적관리 > "양식" 버튼) ---- */
.modal-box-wide {
  max-width: 1100px;
}
.hwpx-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hwpx-tpl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #f9fafb;
}
.hwpx-tpl-row .hwpx-tpl-name {
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 120px;
}
.hwpx-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}
.hwpx-badge-ok { background: var(--color-success-bg); color: var(--color-success); }
.hwpx-badge-warn { background: var(--color-warning-bg); color: var(--color-warning); }
.hwpx-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hwpx-editor {
  display: none;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 12px;
  gap: 12px;
}
.hwpx-editor.active { display: flex; }
.hwpx-field-sidebar {
  flex: 0 0 170px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 520px;
  overflow-y: auto;
}
.hwpx-field-group-label {
  font-size: 12px;
  color: var(--color-text-dim);
  margin: 6px 0 0;
}
.hwpx-field-chip {
  border: 1px solid var(--color-primary);
  color: var(--color-primary-dark);
  background: #eef4ff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: grab;
  user-select: none;
}
.hwpx-field-chip[data-group="static"] {
  border-color: var(--color-success);
  color: var(--color-success);
  background: var(--color-success-bg);
}
.hwpx-field-chip.dragging { opacity: 0.4; }
.hwpx-editor-main {
  flex: 1 1 auto;
  min-width: 0;
  max-height: 520px;
  overflow: auto;
}
.hwpx-table-block {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 14px;
}
.hwpx-table-title { font-size: 13px; color: var(--color-text-dim); margin: 0 0 6px; }
.hwpx-grid {
  display: grid;
  gap: 2px;
  background: var(--color-border);
}
.hwpx-cell {
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 6px;
  font-size: 12px;
  min-height: 40px;
  overflow: hidden;
}
.hwpx-cell.drop-target-ok { background: #eef4ff; }
.hwpx-cell.drop-target-row { outline: 2px solid var(--color-primary); }
/* 통합 양식: 기술인 반복 구간 선택 줄과 구간 안 표 표시 */
.hwpx-block-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px;
  border: 1px solid #b8cef2; border-radius: 8px; background: #f4f8ff; }
.hwpx-page-block { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 16px; }
.hwpx-page-block.hwpx-in-block { border-left: 5px solid #e0a020; background: #fffaf0; }
.hwpx-page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hwpx-cell .hwpx-cell-preview { color: var(--color-text-dim); }
.hwpx-cell .hwpx-cell-mapped {
  display: inline-block;
  margin-top: 2px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}
.hwpx-cell .hwpx-cell-mapped[data-static="1"] { background: var(--color-success); }
.hwpx-para-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hwpx-para-item {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---- 메인페이지(로그인 직후 첫 화면) ---- */
.home-hero {
  width: fit-content;
  margin: 0 auto 24px;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 8px 24px rgba(20, 33, 61, 0.15);
}
.home-hero img {
  display: block;
  height: 400px;
  width: auto;
  max-width: 100%;
}
.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.home-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 6px rgba(20, 33, 61, 0.05);
  color: var(--color-text);
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.home-tile:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(20, 33, 61, 0.12);
}
.home-tile-title { font-size: 16px; font-weight: 700; color: var(--color-primary-dark); }
.home-tile-desc { font-size: 13px; color: var(--color-text-dim); }

/* ---- 공통 사용성: 현재 위치, 키보드 조작, 작은 화면 ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.navbar .brand { text-decoration: none; }
.navbar .nav-links .nav-link {
  padding: 7px 2px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.navbar .nav-links .nav-link.active {
  color: #fff;
  font-weight: 700;
  border-bottom-color: #7cb3ff;
}
.nav-toggle { display: none; }
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(47, 111, 237, 0.34);
  outline-offset: 2px;
}
input[type=text]:focus,
input[type=password]:focus,
input[type=date]:focus,
input[type=datetime-local]:focus,
input[type=number]:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
  outline: none;
}
.btn { font-weight: 600; transition: background .12s ease, border-color .12s ease, transform .12s ease; }
.btn:active { transform: translateY(1px); }
@media (max-width: 1180px) {
  .navbar { height: auto; min-height: 56px; padding: 0 20px; flex-wrap: wrap; }
  .navbar .brand { font-size: 16px; }
  .navbar .nav-links { gap: 12px; }
}
@media (max-width: 820px) {
  .navbar { position: sticky; padding: 0 16px; }
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.26);
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
  }
  .nav-toggle > span:not(.sr-only) { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
  .navbar .nav-links {
    display: none;
    width: calc(100% + 32px);
    margin: 0 -16px;
    padding: 8px 16px 14px;
    gap: 2px;
    flex-wrap: wrap;
    background: #14213d;
    border-top: 1px solid rgba(255,255,255,.12);
  }
  .navbar .nav-links.is-open { display: flex; }
  .navbar .nav-links .nav-link,
  .navbar .nav-links > a:not(.nav-link) { padding: 8px 9px; border-radius: 6px; }
  .navbar .nav-links .nav-link.active { border-bottom: 0; background: rgba(124,179,255,.2); }
  .navbar .user-badge { margin-left: auto; }
  .nav-dropdown-menu { left: 0; right: auto; }
  .open-tabs-bar { top: 56px; padding: 5px 10px; }
  .container, .container-wide { padding: 18px 16px; }
  .toolbar { align-items: flex-start; flex-wrap: wrap; }
  .search-box { flex-wrap: wrap; }
  .search-box input { min-width: 0; }
  .home-hero img { height: auto; width: 100%; }
}
@media (max-width: 480px) {
  body { font-size: 14px; }
  .navbar .brand { max-width: calc(100% - 54px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card { padding: 14px; }
  .btn { padding: 8px 12px; }
  .row-grid { grid-template-columns: 1fr; }
  .open-tabs-bar .open-tab { max-width: 150px; }
}

/* 엑셀 필터처럼 체크박스로 여러 값을 고르는 드롭다운(회사실적 필터 등에서 공용) */
.xlsx-filter { position: relative; }
.xlsx-filter-box {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  border: 1px solid var(--color-border, #ccc); border-radius: 4px; padding: 7px 10px;
  background: #fff; cursor: pointer; font-size: 14px; min-height: 20px;
}
.xlsx-filter-box:focus { outline: 2px solid #7aa7e6; outline-offset: 1px; }
.xlsx-filter-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; }
.xlsx-filter-arrow { color: #888; flex-shrink: 0; }
.xlsx-filter-panel {
  position: absolute; top: 100%; left: 0; z-index: 60; margin-top: 2px;
  min-width: 200px; max-width: 320px; background: #fff; border: 1px solid #ccc;
  border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.12); padding: 6px 0;
}
.xlsx-filter-actions { display: flex; gap: 8px; padding: 2px 10px 6px; border-bottom: 1px solid #eee; }
.xlsx-filter-actions button { background: none; border: none; color: #2563eb; cursor: pointer; font-size: 12px; padding: 2px; }
.xlsx-filter-options { max-height: 220px; overflow-y: auto; padding: 4px 10px; }
.xlsx-filter-options label { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 13px; font-weight: normal; cursor: pointer; }

/* 실적 검색의 다중선택 필터를 열 때만 아래쪽 여백을 늘려 선택지를 보기 쉽게 합니다. */
.filter-expand-card { transition: none; }
.filter-expand-card.filter-expanded { padding-bottom: calc(var(--filter-base-padding, 20px) + var(--filter-extra-height, 0px)); }
.filter-expand-card .xlsx-filter-panel.filter-panel-in-flow {
  position: static; min-width: 0; max-width: none; width: 100%; margin-top: 6px;
}
.filter-expand-card .xlsx-filter-panel.filter-panel-in-flow .xlsx-filter-options {
  max-height: none; overflow-y: visible;
}
.filter-expand-card details.multi-select.filter-panel-in-flow .multi-select-panel {
  position: static; min-width: 0; max-width: none; width: 100%; margin-top: 6px;
}
.filter-expand-card details.multi-select.filter-panel-in-flow .multi-select-panel {
  max-height: none; overflow: visible;
}
.cf-selection-list { display:flex; flex-wrap:wrap; gap:4px; margin-top:5px; }
.cf-selection-chip { display:inline-flex; align-items:center; gap:4px; padding:2px 6px; background:#eef4ff; border-radius:12px; font-size:12px; }
#company-form .form-group { margin-bottom: 7px; }
#company-form h4 { margin: 10px 0 6px; }

/* 기술인 이름 타이핑 -> 선택 드롭다운 (업무중복도/기술인관리 등에서 공용) */
.eng-suggest-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 50;
  background: #fff; border: 1px solid #ccc; border-top: none;
  max-height: 260px; overflow-y: auto; box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.eng-suggest-item { padding: 6px 10px; cursor: pointer; font-size: 14px; }
.eng-suggest-item:hover, .eng-suggest-item.active { background: #eef4ff; }
.eng-suggest-item .muted { margin-left: 6px; font-size: 12px; }

/* 사업수행능력평가서 통합 양식: 기술인 배정 */
.integrated-assign { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; padding: 10px 12px;
  border: 1px solid var(--color-border); border-radius: var(--radius); }
.integrated-assign-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.integrated-assign-label { flex: 0 0 340px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.integrated-assign-people { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.integrated-assign-people label { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: normal; }

/* 통합 양식 매핑: 왼쪽 항목 목록 2단계(분류 → 항목) */
.hwpx-cat-head { display: block; width: 100%; text-align: left; margin: 0 0 4px; padding: 7px 10px; border: 1px solid var(--color-border);
  border-radius: var(--radius); background: var(--color-surface, #fff); font-weight: 600; font-size: 13px; cursor: pointer; }
.hwpx-cat-head.open { background: #eef4ff; border-color: #b8cef2; }
.hwpx-cat-body { padding: 2px 0 8px 8px; margin-bottom: 4px; }
.hwpx-field-chip[data-group="auto"] { border-color: #7a5cc7; color: #5b3fa8; background: #f3effc; }

/* 사업수행능력평가서 양식 관리의 매핑 팝업: 기본보다 좌우 20%, 위아래 10% 크게(1100→1320px, 520→572px) */
.hwpx-modal-large .modal-dialog-wide, .hwpx-modal-large .modal-box-wide { max-width: 1320px; }
.hwpx-modal-large .modal-box { max-height: calc(100vh - 60px); }
.hwpx-modal-large .hwpx-field-sidebar { flex-basis: 204px; max-height: 572px; }
.hwpx-modal-large .hwpx-editor-main { max-height: 572px; }

/* 매핑 편집: 저장·편집 닫기 버튼을 위에 고정 */
.hwpx-editor-actions { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; align-items: center;
  padding: 0 0 10px; margin-bottom: 4px; background: var(--color-surface, #fff); }

/* 모든 화면 우측 상단: 이전 화면·닫기 */
.page-top-actions { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.page-top-right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin-left: auto; }
.page-top-row { display: flex; justify-content: flex-end; margin: 0 0 10px; }

/* 계정 관리: 세부 권한 묶음 */
.perm-group { margin: 6px 0; }
.perm-boxes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.perm-boxes label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: normal; margin: 0; }
.perm-help ul { margin: 6px 0 6px 18px; padding: 0; line-height: 1.7; font-size: 13px; }

/* 계약 상세 차수 첨부 단추(계약서·명단·기타): 한 줄, 같은 크기 */
.phase-file-buttons .phase-file-btn {
  flex: 0 0 auto; width: 72px; padding-left: 0; padding-right: 0;
  justify-content: center; text-align: center; white-space: nowrap;
}
.phase-file-group { grid-column: span 2; min-width: 380px; }
.phase-file-line { display: flex; flex-wrap: nowrap; gap: 18px; align-items: flex-start; }
.phase-file-buttons { display: flex; flex-wrap: nowrap; gap: 6px; }
/* 변경계약·과업중지·청구서 첨부 칸: 단추 하나 폭에 맞춤 */
td.row-file-cell { text-align: center; width: 96px; white-space: nowrap; }
td.row-file-cell-3 { width: 236px; }
.row-file-buttons { display: flex; flex-wrap: nowrap; gap: 6px; justify-content: center; }
/* 읽기 전용 날짜칸(참여자 종료일 등)도 달력 아이콘이 보이게(다른 날짜칸과 모양 통일) */
input[type="date"][readonly]::-webkit-calendar-picker-indicator { display: block; opacity: 1; }
