/* Compact summaries leave room for the work itself; shared type sizes stay intact. */
#projectListContainer .pl-list-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto auto;   /* 검색 · 내 담당 · 정렬 · 보기·관리 · + 새 프로젝트 — 한 줄(2026-10-14, 내 담당 10-28) */
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
#projectListContainer .pl-stage-filters {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
#projectListContainer .pl-list-toolbar button,
#projectListContainer .pl-list-tools summary {
  min-height: 44px;
  font-size: var(--fs-base) !important;
  white-space: nowrap;
}
#projectListContainer .pl-list-search { min-width: 0; }
#projectListContainer #plSearch {
  min-height: 44px;
  font-size: var(--fs-title) !important;
}
#projectListContainer .pl-list-tools { position: relative; }
#projectListContainer .pl-list-tools summary {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
}
#projectListContainer .pl-list-tools-body {
  position: absolute;
  right: 0;
  z-index: 30;
  width: min(36rem, calc(100vw - 3rem));
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px #0f172a1a;
}
#projectListContainer .pl-purpose-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
#projectListContainer .pl-purpose-filters > span { display: none; }
#projectListContainer .pl-budget-summary {   /* 단계 칩 줄 오른쪽 끝(2026-10-14 — 따로 떠 있던 띠) */
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-left: auto;
  color: #64748b;
  font-size: var(--fs-meta);
}
#projectListContainer .pl-budget-summary strong {
  color: #334155;
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
}

#todoSummary.todo-summary-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
#todoSummary .todo-summary-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: var(--fs-base);
}
#todoSummary .todo-summary-item strong { font-variant-numeric: tabular-nums; }
#todoSummary .todo-summary-note { font-size: var(--fs-meta); color: #64748b; }
#todoSummary .is-urgent { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
#todoSummary .is-overdue { color: #9a3412; border-color: #fed7aa; background: #fff7ed; }

.bids-list-layout .bids-list-controls { display: grid; gap: 12px; }
.bids-list-layout .bids-list-heading { flex-wrap: wrap; align-items: center; }
.bids-list-layout .bids-list-status { font-size: var(--fs-meta); }
.bids-list-layout .bids-stage-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.bids-list-layout .bids-stage-filters > button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  min-height: 44px;
  border-width: 1px;
  border-radius: 8px;
  box-shadow: none;
}
.bids-list-layout .bids-stage-filters > button > div {
  margin: 0;
  font-size: var(--fs-base);
  white-space: nowrap;
}
.bids-list-layout .bids-stage-filters > button > div:first-child { order: 2; font-variant-numeric: tabular-nums; }
.bids-list-layout .bids-list-search-controls { display: grid; gap: 10px; }
.bids-list-layout .bids-list-controls button,
.bids-list-layout .bids-list-controls select,
.bids-list-layout .bids-list-controls input { min-height: 40px; }
.bids-list-layout .bids-list-controls input,
.bids-list-layout .bids-list-controls select { font-size: var(--fs-title); }
.bids-list-layout .bids-advanced-filters { border-top: 1px solid #e2e8f0; }
.bids-list-layout .bids-advanced-filters > summary {
  padding: 10px 0 0;
  min-height: 40px;
  color: #475569;
  font-size: var(--fs-base);
  font-weight: 700;
  cursor: pointer;
}
.bids-list-layout .bids-advanced-body { display: grid; gap: 12px; padding-top: 12px; }

.pa-analysis-start { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.pa-analysis-upload { padding: 32px 24px; }
.pa-analysis-resume { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 16px; padding: 24px; }

@media (max-width: 600px) {
  #projectListContainer .pl-list-toolbar { grid-template-columns: 1fr auto; }
  #projectListContainer .pl-list-search { grid-column: 1 / -1; }
  #projectListContainer .pl-create-btn { grid-column: 1 / -1; }   /* 주 버튼은 폰에서 한 줄 전체 */
  #projectListContainer .pl-sort-seg > button { flex: 1 1 0; }     /* 정렬 두 단추가 칸을 나눠 채운다(빈 흰 칸 없음) */
  #projectListContainer .pl-stage-filters > button { flex: 1 0 auto; }
  .bids-list-layout .bids-list-header-actions { width: 100%; }
  .bids-list-layout .bids-list-controls button,
  .bids-list-layout .bids-list-controls select,
  .bids-list-layout .bids-list-controls input { min-height: 44px; }
  .bids-list-layout .bids-search-row #bidsSearch { min-width: 0; flex-basis: calc(100% - 90px); }
  .bids-list-layout .bids-search-row #bidsSort { width: 100%; }
  .pa-analysis-start { grid-template-columns: minmax(0, 1fr); }
  .pa-analysis-upload, .pa-analysis-resume { padding: 24px 16px; }
}

/* 🏢 업체 DB 카드 — 열 수를 화면 폭(md:·lg:)이 아니라 «실제 남은 폭»으로 정한다(2026-10-14 사장님 «밀리면 왼쪽 내용이 깔끔하게»).
   옆 패널이 본문을 760px 밀어도 카드가 300px 아래로 찌그러지지 않고 2열·1열로 내려간다. */
.cl-card-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }


/* 📋 프로젝트 목록 표 — 769~900 의 «줄마다 폭 100% 고정 표»(compact-sidebar.css)에서 되돌린다(2026-10-15 사장님 «뭔가 이상한»).
   그 규칙은 칸 폭을 «표 폭 ÷ 칸 수»로 만들어 기간이 계약금액 칸 위로 넘쳤다. 표는 감싸는 상자가 가로로 스크롤한다(min-width 900).
   ≤768 의 table{display:block!important}(style.css)도 같이 되돌리므로 !important — 선례: .naesu-table·.gg-table */
@media (max-width: 900px) {
  #projectListContainer table.pl-table { display: table !important; overflow: visible !important; max-width: none !important; }
  #projectListContainer table.pl-table thead { display: table-header-group !important; width: auto !important; }
  #projectListContainer table.pl-table tbody { display: table-row-group !important; width: auto !important; }
  #projectListContainer table.pl-table tr { display: table-row !important; width: auto !important; }
}
/* 줄바꿈 — 짧은 칸(유형·PM·기간…)은 한 줄, 이름은 띄어쓰기에서만 접는다(2026-10-15 사장님 «글자도 두 줄로» — «행사/이벤|트» 처럼 낱말 가운데서 끊겼다) */
#projectListContainer table.pl-table td { white-space: nowrap; }
#projectListContainer table.pl-table td:first-child { white-space: normal; word-break: keep-all; }

/* 🧾 프로젝트 대시보드 세금계산서 표(project-tax-invoices.js) — .pl-table 과 같은 이유로 ≤900 에서 표 부품으로 되돌린다(감싸는 상자가 가로로 스크롤) */
@media (max-width: 900px) {
  table.pti-table { display: table !important; overflow: visible !important; max-width: none !important; }
  table.pti-table thead { display: table-header-group !important; width: auto !important; }
  table.pti-table tbody { display: table-row-group !important; width: auto !important; }
  table.pti-table tr { display: table-row !important; width: auto !important; }
}

/* 프로젝트 보관·합치기 창 */
.project-archive-select {
  display: block; width: 100%; min-height: 44px; margin: 4px 0 12px;
  border: 1px solid #cbd5e1; border-radius: 6px; padding: 8px; font-size: 16px;
}
.project-archive-check:not([hidden]) {
  display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer;
}
.project-archive-check input[type="checkbox"] { flex: none; width: 20px; height: 20px; }

/* 재무 > 직원 세금계산서 */
#myTaxInvoicesContainer { font-size: var(--fs-base); }
.pti-staff-toolbar, .pti-project > summary { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.pti-staff-toolbar { justify-content: flex-end; margin-bottom: .75rem; }
.pti-request-filter:not(:empty) { margin-bottom: .75rem; }
.pti-staff-toolbar .pti-refresh { padding: 4px 10px; font-size: var(--fs-meta); }
.pti-staff-toolbar small, .pti-project > summary span, .pti-date, .pti-item { color: #475569; font-size: var(--fs-meta); }
.pti-review { display: flex; flex-direction: column; gap: .3rem; padding: .75rem; border-top: 1px solid #fde68a; overflow-wrap: anywhere; }
.pti-staff-review .pti-candidate-actions { flex-wrap: wrap; align-items: center; }
.pti-staff-review .pti-dismiss { background: transparent; border: 0; text-decoration: underline; }
.pti-staff-review .pti-take { border-color: #94a3b8; background: white; color: #334155; }
.pti-staff-review.pti-unassigned { overflow: hidden; background: white; border-color: #e2e8f0; }
.pti-unassigned .pti-candidate-heading { background: #f8fafc; color: #475569; }
.pti-unassigned-row {
  display: grid; align-items: center; gap: .5rem; padding: .35rem .75rem; border-top: 1px solid #e2e8f0;
  grid-template-columns: 3rem 2.5rem minmax(0, 1fr) minmax(0, 1.3fr) 9rem 10rem;
}
.pti-unassigned-date, .pti-direction, .pti-unassigned-item { color: #475569; font-size: var(--fs-meta); }
.pti-unassigned-item { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pti-unassigned-vendor { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pti-unassigned-amount { min-width: 0; overflow-wrap: anywhere; }
.pti-unassigned-amount { text-align: right; font-variant-numeric: tabular-nums; }
.pti-unassigned-row .pti-candidate-actions { min-width: 0; justify-content: flex-end; }
.pti-unassigned .pti-project-picker { width: 100%; }
.pti-more > summary { cursor: pointer; padding: .5rem .75rem; color: #475569; border-top: 1px solid #e2e8f0; }
.pti-more[open] > summary .pti-when-closed, .pti-more:not([open]) > summary .pti-when-open { display: none; }
.pti-project-picker { min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px; }
.pti-project, .pti-quiet { margin: .65rem 0; border: 1px solid #e2e8f0; border-radius: 12px; background: white; overflow: hidden; }
.pti-project > summary, .pti-quiet > summary, .pti-cancelled > summary { cursor: pointer; padding: .7rem .85rem; }
.pti-project > summary { background: #f8fafc; overflow-wrap: anywhere; }
.pti-project > summary::before { content: '▸'; color: #64748b; }
.pti-project[open] > summary::before { content: '▾'; }
.pti-project[open] > summary .pti-closed-count, .pti-quiet[open] > summary .pti-when-closed, .pti-quiet:not([open]) > summary .pti-when-open { display: none; }
.pti-quiet { border-inline: 0; }
.pti-quiet .pti-project { margin: .5rem 0; }
.pti-staff-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pti-staff-table :is(td, th) { padding: .65rem; border-bottom: 1px solid #e2e8f0; text-align: left; overflow-wrap: anywhere; }
.pti-staff-table th { color: #64748b; font-size: var(--fs-meta); }
.pti-staff-table th:nth-child(4), .pti-staff-table .pti-total { font-weight: 700; text-align: right; }
.pti-state { display: inline-block; white-space: nowrap; padding: .15rem .45rem; border-radius: 6px; font-size: var(--fs-meta); background: #f1f5f9; color: #475569; }
.pti-state.issued { background: #eff6ff; color: #1d4ed8; }
.pti-state.received { background: #fff7ed; color: #9a3412; }
.pti-state.issuedOk, .pti-state.receivedOk { background: #ecfdf5; color: #047857; }
.pti-original, .pti-project-link { color: #1d4ed8; text-decoration: underline; font-size: var(--fs-meta); }
.pti-project-link { margin: .4rem .85rem; }
@media (min-width: 769px) {
  #myTaxInvoicesContainer table.pti-staff-table { display: table !important; }
  #myTaxInvoicesContainer .pti-staff-table thead { display: table-header-group !important; }
  #myTaxInvoicesContainer .pti-staff-table tbody { display: table-row-group !important; }
  #myTaxInvoicesContainer .pti-staff-table tr { display: table-row !important; }
  #myTaxInvoicesContainer .pti-staff-table :is(td, th) { display: table-cell !important; }
  .pti-staff-table th:nth-child(1) { width: 6.75rem; }
  .pti-staff-table th:nth-child(2) { width: 23%; }
  .pti-staff-table th:nth-child(4) { width: 20%; }
  .pti-staff-table th:nth-child(5) { width: 6.5rem; }
  .pti-staff-table th:nth-child(6) { width: 3.75rem; }
}
@media (max-width: 900px) {
  #myTaxInvoicesContainer :is(button, a, summary) { min-height: 44px; }
  #myTaxInvoicesContainer .pti-staff-table :is(.pti-party, .pti-item, .pti-total) { white-space: normal !important; }
  .pti-unassigned-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto 5.7rem;
    grid-template-areas: "vendor vendor vendor amount actions" "date direction item item actions";
    align-content: center; gap: .15rem .35rem;
  }
  .pti-unassigned-vendor { grid-area: vendor; align-self: end; }
  .pti-unassigned-amount { grid-area: amount; align-self: end; }
  .pti-unassigned-date { grid-area: date; align-self: start; }
  .pti-unassigned-row .pti-direction { grid-area: direction; align-self: start; }
  .pti-unassigned-item { grid-area: item; align-self: start; }
  .pti-unassigned-row .pti-candidate-actions { grid-area: actions; flex-direction: column; gap: 0; }
  .pti-unassigned-row .pti-candidate-actions button { min-width: 44px; }
}
@media (max-width: 768px) {
  .pti-unassigned-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas: "vendor vendor vendor amount" "date direction item item" "actions actions actions actions";
  }
  .pti-unassigned-row .pti-candidate-actions { flex-direction: row; gap: 12px; }
  .pti-staff-review .pti-dismiss, .pti-staff-table .pti-original, .pti-more > summary { padding-block: 12px; }
  #myTaxInvoicesContainer .pti-staff-table, #myTaxInvoicesContainer .pti-staff-table tbody { display: block !important; width: 100%; }
  #myTaxInvoicesContainer .pti-staff-table thead { display: none !important; }
  #myTaxInvoicesContainer .pti-staff-table tr { display: grid !important; grid-template-columns: auto minmax(0,1fr) auto auto; grid-template-areas: "party party total total" "date item source status"; gap: .2rem .5rem; align-items: center; padding: .65rem .85rem; border-bottom: 1px solid #e2e8f0; }
  #myTaxInvoicesContainer .pti-staff-table td { padding: 0; border: 0; min-width: 0; }
  .pti-date { grid-area: date; }
  .pti-party { grid-area: party; font-weight: 700; }
  .pti-total { grid-area: total; }
  .pti-item { grid-area: item; }
  .pti-status { grid-area: status; text-align: right; }
  .pti-source { grid-area: source; }
}
