.monthly-work-layout{display:grid;gap:24px;min-width:0}.monthly-work-layout>*{min-width:0}.monthly-work-filters .section-heading{align-items:flex-start}.monthly-work-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:18px}.monthly-work-layout table{min-width:760px}.monthly-work-task-table{min-width:1260px!important}.monthly-work-layout td{white-space:pre-line;overflow-wrap:anywhere}.monthly-work-layout .table-wrap{margin-top:18px;max-width:100%;overflow-x:auto}.pagination{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}.monthly-work-choice-list{display:grid;gap:10px;margin-top:14px}.monthly-work-choice{display:flex;align-items:flex-start;gap:12px;padding:14px;border:1px solid var(--color-border);border-radius:12px;background:#fff;cursor:pointer}.monthly-work-choice:has(input:checked){border-color:#5a9088;background:#f2f8f7}.monthly-work-choice input{width:20px;height:20px;flex:0 0 auto;margin-top:2px}.monthly-work-choice strong,.monthly-work-choice small{display:block}.monthly-work-choice small{margin-top:4px;color:var(--color-muted);line-height:1.45}.monthly-work-item-fields{display:grid;gap:16px;margin-top:18px;border:1px solid var(--color-border);border-radius:12px;padding:16px;background:#f8fbfa}.monthly-work-item-fields h3{margin:0}.monthly-work-item-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.monthly-work-layout dialog{width:min(900px,calc(100% - 28px));max-height:calc(100dvh - 28px);overflow:auto;padding:0}.monthly-work-layout dialog form,.monthly-work-edit-dialog form{padding:24px}.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border-bottom:1px solid var(--color-border);margin-bottom:20px;padding-bottom:16px}.dialog-heading h2{margin:2px 0 6px}.icon-button{display:grid;place-items:center;width:40px;height:40px;border:1px solid var(--color-border);border-radius:10px;background:#fff;font-size:1.8rem;line-height:1;color:var(--color-primary)}.monthly-work-layout fieldset{margin:18px 0;border:0;padding:0}.monthly-work-layout legend{font-size:1.05rem;font-weight:800}.monthly-work-confirmation{display:grid;gap:8px;border:1px solid var(--color-border);border-radius:12px;padding:16px;background:#f8fbfa}.monthly-work-confirmation p{margin:0}.dialog-actions{display:flex;justify-content:space-between;gap:10px;margin-top:24px;padding-top:18px;border-top:1px solid var(--color-border)}.dialog-actions #monthly-work-next-step,.dialog-actions #monthly-work-submit{margin-left:auto}.empty-state{margin:18px 0 0;padding:16px;border:1px dashed var(--color-border);border-radius:10px;color:var(--color-muted);text-align:center}@media(max-width:900px){.monthly-work-filter-grid{grid-template-columns:1fr}.monthly-work-item-field-grid{grid-template-columns:1fr}}@media(max-width:600px){.monthly-work-filters .section-heading{display:grid}.monthly-work-filters .primary-button{width:100%}.monthly-work-layout dialog form,.monthly-work-edit-dialog form{padding:18px}.dialog-actions{flex-wrap:wrap}.dialog-actions button{width:100%}.dialog-actions #monthly-work-next-step,.dialog-actions #monthly-work-submit{margin-left:0}.pagination{justify-content:stretch}.pagination button{flex:1}.monthly-work-layout table{min-width:760px}.monthly-work-task-table{min-width:1260px!important}}
.monthly-work-layout #monthly-work-edit-dialog form{padding:24px}
.monthly-work-complete{display:flex;align-items:center;gap:.6rem;margin:1rem 0;font-weight:700}.monthly-work-complete input{width:1.15rem;height:1.15rem}.monthly-work-documents{display:grid;gap:.5rem;margin:.75rem 0 1rem}.monthly-work-document{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.6rem .8rem;border:1px solid var(--color-border);border-radius:.6rem;background:#f4faf8}
@media(max-width:600px){.monthly-work-layout #monthly-work-edit-dialog form{padding:18px}}
.overdue-badge{display:inline-block;margin-left:4px;padding:1px 8px;border-radius:999px;background:#fbe9e7;color:#a4321f;font-size:.78rem;font-weight:800;white-space:nowrap}
.assignee-filter{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:10px 0 0}
.assignee-chip{display:inline-block;border:1px solid var(--color-border);border-radius:999px;background:#fff;padding:2px 12px;font-size:.85rem;cursor:pointer;color:inherit}
.assignee-chip.is-active{border-color:#2f6f62;background:#e3f2ec;color:#1d5c47;font-weight:800}
.assignee-chip:focus-visible{outline:3px solid #2f6f62;outline-offset:2px}
td .assignee-chip{margin:1px 4px 1px 0}
.rollover-badge{display:inline-block;margin-left:4px;padding:1px 8px;border-radius:999px;background:#e8ecf7;color:#33508f;font-size:.78rem;font-weight:800;white-space:nowrap}
.assignee-progress{margin-top:14px;border:1px solid var(--color-border);border-radius:12px;padding:14px 16px;background:#f8fbfa}
.assignee-progress h3{margin:0 0 4px;font-size:1rem}
.assignee-progress table{min-width:560px}
.detail-heading-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
/* UI-080：逐項目列的整月統計、三態標籤與未作業列。 */
.monthly-work-summary{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px;padding:0}
.monthly-work-summary-item{background:#eef5f3;border-radius:10px;padding:6px 12px;font-size:.86rem;font-weight:700;color:#2f6f62}
.work-status-chip{display:inline-block;padding:2px 9px;border-radius:999px;font-size:.78rem;font-weight:800;white-space:nowrap}
.work-status-chip--completed{background:#e3f2ec;color:#1d5c47}
.work-status-chip--in_progress{background:#fdf3e3;color:#8a5a12}
.work-status-chip--unstarted{background:#fbeaec;color:#9b3040}
.work-status-note{display:block;margin-top:3px;color:var(--color-text-soft,#4d6a64);font-size:.74rem}
.monthly-work-row--unstarted td{background:#fdfbfb}
/* UI-081：申告期限欄位。狀態色與 contract-workbench-theme.css 的申告期限提醒完全一致，
 * 同一份項目在兩個畫面必須看起來是同一個狀態。 */
.monthly-page td.is-numeric{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.monthly-page .status-badge{padding:2px 9px;font-size:.78rem;font-weight:800;white-space:nowrap}
.monthly-page .status-badge[data-tone=ok]{background:#e3f2ec;color:#1d5c47}
.monthly-page .status-badge[data-tone=warn]{background:#fdf3e3;color:#8a5a12}
.monthly-page .status-badge[data-tone=danger]{background:#fbeaec;color:#9b3040}
/* UI-082：已作業清單的月結狀態與查詢月份控制項。 */
.monthly-work-detail-month-field{min-width:160px;margin:0}
.monthly-work-detail-month-field label{display:block;margin-bottom:4px;font-size:.82rem;font-weight:700}
.monthly-work-closing-status{margin:0 0 12px}
.monthly-work-closing-status[data-tone=closed]{border-color:#1d5c47;background:#e3f2ec;color:#1d5c47}
.detail-heading-actions{flex-wrap:wrap;align-items:flex-end;gap:10px}
/* UI-104：總表的備註欄。過長時在表格內截斷，完整內容放在 title（滑鼠移上顯示）。 */
.monthly-work-task-table .monthly-work-note-cell{max-width:16em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* UI-107：作業狀態可點（切到已作業清單該列）、請款狀態連到請款作業頁、按鈕三態、跳轉後的短暫標亮。 */
button.work-status-chip{border:0;font:inherit;font-size:.78rem;font-weight:800;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
button.work-status-chip:hover{filter:brightness(.96)}
button.work-status-chip:focus-visible,.monthly-work-payment-status:focus-visible{outline:3px solid #2f6f62;outline-offset:2px}
.monthly-work-link-icon{text-decoration:none;display:inline-block;margin-left:2px}
a.monthly-work-payment-status{color:#2f6f62;font-weight:800;white-space:nowrap}
#monthly-work-list .secondary-button[disabled]{opacity:.6;cursor:not-allowed}
.monthly-work-task-table tbody td{transition:background-color .6s ease}
.monthly-work-task-table tbody tr.is-flash td{background:#fff6d9;box-shadow:inset 0 0 0 9999px rgb(255 214 102 / 18%);transition:none}
@media (prefers-reduced-motion: reduce){.monthly-work-task-table tbody td{transition:none}}
/* UI-108：移除（次要紅色）、停用原因小字、全部管轄區的逐區月結狀態、移除確認對話框。 */
.monthly-work-layout td.monthly-work-action-cell{white-space:nowrap}
.monthly-page .monthly-work-remove-button{color:#a3322a;border-color:#f0c9c4}
.monthly-work-remove-button:not([disabled]):hover{background:#fbe9e7}
.monthly-work-remove-button[disabled]{opacity:.55;cursor:not-allowed}
.monthly-work-remove-why{display:block;max-width:16em;margin-top:4px;color:var(--color-muted,#71807d);font-size:.76rem;line-height:1.4;white-space:normal}
.monthly-page .primary-button.danger-button{background:#a3322a;border-color:#a3322a;color:#fff}
.monthly-page .primary-button.danger-button:not([disabled]):hover{background:#8c2a23;border-color:#8c2a23}
.monthly-work-closing-line{display:block;padding:2px 0}
.monthly-work-closing-line+.monthly-work-closing-line{border-top:1px dashed var(--color-border);margin-top:4px;padding-top:6px}
.monthly-work-closing-line[data-tone=closed]{color:#1d5c47}
.monthly-work-area-reopen{padding:2px 10px;min-height:0;font-size:.8rem;margin-left:6px}
.monthly-work-rollover-area{color:#2f6f62;font-weight:700}
.monthly-work-remove-summary{display:grid;grid-template-columns:7em minmax(0,1fr);gap:4px 10px;margin:0 0 14px}
.monthly-work-remove-summary dt{color:var(--color-muted,#71807d)}
.monthly-work-remove-summary dd{margin:0;overflow-wrap:anywhere}
/* UI-109：送審分輪狀態（逐輪一行＋尚未送出）、送審欄、查看按鈕。 */
.monthly-work-submission{display:grid;gap:6px}
.monthly-work-submission+.monthly-work-submission{margin-top:10px;padding-top:10px;border-top:1px dashed var(--color-border)}
.monthly-work-submission-area{display:block;color:#2f6f62}
.monthly-work-round-line{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--color-border);border-radius:10px;background:#fff}
.monthly-work-round-line--pending{border-style:dashed;background:transparent}
.monthly-work-round-label{font-weight:800}
.monthly-work-round-note{flex-basis:100%;color:var(--color-muted,#71807d);font-size:.8rem;overflow-wrap:anywhere}
.monthly-work-round-hint{color:var(--color-muted,#71807d);font-size:.8rem}
.monthly-work-round-withdraw{padding:2px 10px;min-height:0;font-size:.8rem;margin-left:auto}
.monthly-work-layout td.monthly-work-round-cell{white-space:nowrap}
.monthly-work-choice-meta{display:block;margin-top:4px;color:var(--color-muted);font-size:.86rem}
/* UI-111：待作業清單的追加列（審核後才加入項目的服務）。 */
.work-status-chip--addition{position:relative;background:#e7eef9;color:#2b4f86;cursor:help}
/* 螢幕閱讀器用的服務名稱（.sr-only 為 absolute）收在 chip 內，避免窄螢幕時被排到表格外撐出橫向捲動。 */

/* UI-121（核准④–⑧）：已建立清單（#monthly-work-list）與已作業清單（.monthly-work-task-table）排版。
   內容 13px、表頭 12px；短欄位與表頭不換行；長文字（客戶名稱／会社名、管轄區、備註）最多 2 行＋…（title 帶全文）；
   項目期間固定兩行；欄位多時在 .table-wrap 內左右捲動，客戶名稱欄固定在左。 */
.monthly-work-layout table:has(#monthly-work-list),.monthly-work-layout .monthly-work-task-table{font-size:13px;line-height:1.5}
.monthly-work-layout table:has(#monthly-work-list) th,.monthly-work-layout .monthly-work-task-table th{font-size:12px;white-space:nowrap}
#monthly-work-list td,#monthly-work-tasks td{white-space:nowrap;vertical-align:top}
#monthly-work-list td button,#monthly-work-tasks td button{white-space:nowrap}
#monthly-work-list td.monthly-work-clamp-cell,#monthly-work-tasks td.monthly-work-clamp-cell{white-space:normal;min-width:12em;max-width:16em}
.monthly-work-layout .monthly-work-clamp{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;max-width:16em}
.monthly-work-task-table .monthly-work-note-cell{white-space:normal;text-overflow:clip}
:where(#monthly-work-list td[data-label="客戶名稱"],#monthly-work-tasks td:nth-child(4)){position:sticky;left:0;z-index:1;background-color:var(--color-surface,#fff);box-shadow:1px 0 0 var(--color-border,#e9e3de)}
:where(.monthly-work-layout table:has(#monthly-work-list) thead th:nth-child(2),.monthly-work-task-table thead th:nth-child(4)){position:sticky;left:0;z-index:2}
/* UI-123：作業範圍的部門 chip（色票同 customer-theme.css 的 UI-122 部門 chip）；送審區塊的部門輪次標籤。 */
.department-chip{display:inline-block;border-radius:999px;padding:0 9px;font-size:12px;font-weight:700;line-height:1.7;white-space:nowrap}
.department-chip[data-department="tax"]{background:#e7f1ef;color:#3f6e67}
.department-chip[data-department="administrative"]{background:#f6eedd;color:#7a5a1d}
.department-chip[data-department="labor"]{background:#e6e9f6;color:#3f4f8f}
/* UI-125（裁決⑪⑫）：待作業清單合併查找條件——條件列（作業範圍、擔當、作業狀態、期限、客戶、清除條件）、
   期限欄的期限種類、「期間中」chip、列內作業月份下拉。 */
.monthly-work-pending .section-heading{align-items:flex-start;gap:14px;flex-wrap:wrap}
.monthly-work-pending .monthly-work-filter-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,170px),1fr));align-items:end;margin:14px 0 6px}
.monthly-work-pending .monthly-work-filter-grid .field{margin:0;min-width:0}
.monthly-work-pending .monthly-work-filter-grid select,.monthly-work-pending .monthly-work-filter-grid input{width:100%;min-width:0;box-sizing:border-box}
.monthly-work-filter-actions .secondary-button{width:100%}
.monthly-work-list-meta{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
.monthly-work-list-meta .monthly-work-summary{margin:0}
.monthly-work-list-meta .status{margin:0}
.monthly-work-due-kind{display:block;color:var(--color-muted,#71807d);font-size:11px;line-height:1.3}
.work-status-chip--period{background:#fdf3dc;color:#8a5a00}
.monthly-work-add-control{display:inline-flex;align-items:center;gap:6px}
.monthly-work-add-month{font:inherit;font-size:12px;padding:3px 6px;border:1px solid var(--color-border);border-radius:8px;background:#fff;color:inherit;max-width:9em}
/* UI-126（裁決①④）：擔當欄的共做擔當 chip（灰色，靜態稿 --chip-co／--co）。 */
.collaborator-chip{display:inline-block;margin:2px 4px 2px 0;padding:0 9px;border-radius:999px;background:#eef0ef;color:#5d6b69;font-size:12px;font-weight:700;line-height:1.7;white-space:nowrap}
.collaborator-chip-label{margin-right:3px;font-weight:600}
