/* 專案成本彙整（app/project_cost.js） */
/* 左側選單的獨立入口（看不到採購作業、但有專案成本權限的人才顯示）。 */
.app-layout .module-card[data-project-cost-entry]::before { content: "成"; }
/* 視窗本身可往下捲：螢幕較矮或展開查詢條件時，清單仍保留可閱讀的高度。 */
.project-cost-dialog .pc-shell { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.project-cost-dialog .pc-shell > * { flex: 0 0 auto; }
.project-cost-dialog .pc-note { margin: 0; padding: 8px 10px; border-radius: 6px; background: #eef4f0; color: #1f2421; line-height: 1.6; }
.project-cost-dialog .pc-search { margin: 0; }
.pc-filter-grid label small { grid-column: 2; color: #6b6f6c; }
.pc-date-range { display: grid; grid-template-columns: 7em minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.pc-date-range input { margin: 0; min-width: 0; }
.pc-range-hint { margin: 0 0 6px; }
.pc-actions { flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pc-switch { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; padding: 2px 10px; border: 1px solid #d9d2c5; border-radius: 6px; background: #fbf8f2; }
.pc-switch .checkline { display: inline-flex; align-items: center; gap: 6px; width: auto; margin: 0; white-space: nowrap; }
.pc-switch input[type="radio"] { width: 18px; height: 18px; min-width: 18px; padding: 0; flex: 0 0 18px; margin: 0; }

.pc-totals { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-totals:empty, .pc-notices:empty { display: none; }
.pc-total { display: grid; gap: 2px; min-width: 140px; flex: 1 1 140px; padding: 8px 12px; border: 1px solid #d9d2c5; border-radius: 8px; background: #fffaf3; }
.pc-total small { color: #5c615e; }
.pc-total strong { font-size: 1.1em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pc-notices { display: grid; gap: 6px; }
.pc-notice { margin: 0; }

.pc-list { min-height: 220px; }
.pc-list .purchase-record-cell { height: auto; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; overflow-wrap: anywhere; }
.project-cost-dialog .pc-list > .table-scroll { max-width: 100%; max-height: min(70vh, 760px); overflow: auto; scrollbar-gutter: stable; }
.pc-list .pc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-list .pc-project-row > td { background: #f3f1ea; }
.pc-list .pc-project-row { cursor: pointer; }
.pc-list .pc-project-row:hover > td, .pc-list .pc-project-row:focus-within > td { background: #e9efe9; }
.pc-list .pc-name-cell .pc-open-project { display: block; width: 100%; min-height: 0; height: auto; padding: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; font-weight: 700; line-height: 1.5; }
.project-cost-dialog .pc-project-title { margin: 0; font-size: 1.1em; font-weight: 700; overflow-wrap: anywhere; }
.pc-list .pc-order-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.pc-list .pc-order-name small { flex: 1 1 100%; color: #5c615e; }
.pc-list .pc-order-name .pc-row-note { color: #9a5b00; }
.pc-kind { padding: 0 6px; border-radius: 4px; background: #ebe7dd; color: #3b3f3c; font-size: 0.85em; line-height: 22px; white-space: nowrap; }
.pc-kind-delivery { background: #e7eef8; color: #1c3d63; }
.pc-list .pc-item-name { white-space: pre-line; }
.pc-list .pc-total-row > td { position: sticky; bottom: 0; background: #1f2723; color: #fff; font-weight: 700; }
.pc-state { padding: 16px 4px; }
.pc-error { color: #b3261e; }

@media (max-width: 700px) {
  .pc-date-range { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .pc-date-range .search-field-caption { grid-column: 1 / -1; }
  .pc-filter-grid label small { grid-column: 1; }
  .pc-actions > button { flex: 1 1 auto; }
  .pc-total { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .project-cost-dialog .pc-list > .table-scroll { max-height: none; }
}
