.reimbursements { min-width: 0; max-width: 100%; }
.reimbursements .er-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.reimbursements button { background: #ddd; color: #222; border-color: #ddd; }
.reimbursements button:hover { background: #ddd; color: #222; }
.reimbursements button:active,
.reimbursements .er-toolbar button[aria-pressed="true"],
.reimbursements .er-toolbar button[aria-pressed="true"]:hover { background: var(--accent, #c26e2c); color: white; border-color: var(--accent, #c26e2c); }
.reimbursements .er-status { min-height: 24px; white-space: pre-wrap; color: #176b35; font-weight: 600; }
.reimbursements .er-status[data-error="1"] { color: #a42424; }
.reimbursements .er-hint { padding: 10px 14px; background: #fff7dd; border-left: 4px solid #bc851a; }
.reimbursements .er-tax-warning { display: block; padding: 8px 10px; color: #6b3b00; background: #fff0a8; border: 1px solid #bb850d; border-radius: 5px; font-weight: 600; white-space: normal; }
.reimbursements .er-form { border: 1px solid var(--border, #ccc); background: white; border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.reimbursements .er-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.reimbursements label { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.reimbursements input, .reimbursements select, .reimbursements textarea { min-width: 0; max-width: 100%; font: inherit; }
.reimbursements .er-grid input, .reimbursements .er-grid select, .reimbursements .er-grid textarea { width: 100%; min-height: 42px; }
.reimbursements .er-project-field, .reimbursements .er-payee-field { min-width: 0; }
.reimbursements .er-project-picker, .reimbursements .er-payee-picker { position: relative; display: flex; align-items: flex-end; gap: 6px; min-width: 0; }
.reimbursements .er-project-picker > label, .reimbursements .er-payee-picker > label { flex: 1 1 auto; }
.reimbursements .er-project-toggle, .reimbursements .er-payee-toggle { flex: 0 0 42px; min-height: 42px; }
.reimbursements .er-project-options, .reimbursements .er-payee-options { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; max-height: 240px; overflow-y: auto; background: white; border: 1px solid #b8c3c9; border-radius: 6px; box-shadow: 0 8px 20px #10253533; }
.reimbursements .er-project-options[hidden], .reimbursements .er-payee-options[hidden] { display: none; }
.reimbursements .er-project-option, .reimbursements .er-payee-option { display: block; width: 100%; padding: 9px 10px; text-align: left; background: white; color: #222; border: 0; border-radius: 0; }
.reimbursements .er-project-option:hover, .reimbursements .er-project-option:focus, .reimbursements .er-payee-option:hover, .reimbursements .er-payee-option:focus { background: #fff0d9; color: #222; }
.reimbursements .er-project-empty, .reimbursements .er-payee-empty { margin: 0; padding: 10px; color: #555; }
.reimbursements .er-grid .er-incomplete { background: #fff0a8; border-color: #bb850d; }
.reimbursements .er-grid .er-incomplete:focus { background: #fff0a8; }
.reimbursements .er-buyer-tax-review { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 9px 11px; border: 1px solid #d1d9dc; border-radius: 6px; background: #f8fafb; }
.reimbursements .er-buyer-tax-review span { overflow-wrap: anywhere; }
.reimbursements .er-buyer-tax-review small { color: #555; line-height: 1.4; }
.reimbursements textarea { resize: vertical; }
.reimbursements .er-voice { align-self: flex-start; padding: 5px 10px; font-size: 13px; }
.reimbursements .er-voice-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.reimbursements .er-voice-review { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; width: 100%; padding: 8px; border: 1px solid #d1d9dc; border-radius: 6px; background: #f8fafb; }
.reimbursements .er-voice-review[hidden], .reimbursements .er-voice-review select[hidden] { display: none; }
.reimbursements .er-voice-review label { flex: 1 1 100%; }
.reimbursements .er-file-button { padding: 9px 12px; border: 1px solid #7d8c97; border-radius: 6px; background: #f3f7fa; cursor: pointer; }
.reimbursements .er-file-button input { width: 220px; max-width: 100%; font-size: 12px; }
.reimbursements .er-filters input { width: 280px; }
.reimbursements .er-summary { font-weight: 600; }
.reimbursements .er-table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--border, #ddd); background: white; }
.reimbursements .er-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.reimbursements .er-table th, .reimbursements .er-table td { padding: 9px; vertical-align: top; border-bottom: 1px solid #e1e6e9; min-width: 130px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.reimbursements .er-table th { background: #edf3f7; white-space: nowrap; }
.reimbursements .er-table th:first-child, .reimbursements .er-table td:first-child { min-width: 52px; width: 52px; }
.reimbursements .er-table:not(.er-table-compact) .er-col-claim_number { position: sticky; left: 0; background: #f4f8fa; z-index: 2; min-width: 130px; }
.reimbursements .er-table:not(.er-table-compact) .er-col-applicant_name { position: sticky; left: 130px; background: #f4f8fa; z-index: 2; min-width: 130px; }
.reimbursements .er-table input:not([type="checkbox"]), .reimbursements .er-table select, .reimbursements .er-table textarea { width: 180px; }
.reimbursements .er-table input[type="checkbox"] { width: 20px; height: 20px; }
.reimbursements .er-row-actions, .reimbursements .er-attachments { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.reimbursements .er-row-actions button { white-space: nowrap; }
.reimbursements .er-table .er-claim-link { padding: 0; min-height: 0; border: 0; background: transparent; color: #a65317; text-decoration: underline; font-weight: 600; white-space: nowrap; }
.reimbursements .er-table .er-claim-link:hover { background: transparent; color: #873e0b; }
.reimbursements .er-row-status { color: #7c4b0e; }
.reimbursements .er-badge { display: inline-block; background: #e4eef4; border-radius: 5px; padding: 4px 7px; }
.reimbursements .er-tax-badge { display: block; width: fit-content; margin-top: 5px; padding: 4px 7px; background: #fff0a8; color: #6b3b00; border: 1px solid #bb850d; border-radius: 5px; font-weight: 600; }
.er-floating { position: fixed; z-index: 1500; top: 12vh; left: 50%; transform: translateX(-50%); width: min(650px, 94vw); height: min(650px, 80vh); min-width: min(280px, 94vw); min-height: 180px; max-width: 96vw; max-height: 94vh; resize: both; overflow: hidden; display: flex; flex-direction: column; background: white; border: 1px solid #60798c; border-radius: 8px; box-shadow: 0 10px 45px #142a4266; }
.er-floating-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; background: #15394f; color: white; cursor: move; touch-action: none; }
.er-floating-head strong { overflow-wrap: anywhere; min-width: 0; }
.er-floating-head button { flex-shrink: 0; }
.er-floating-content { min-height: 0; flex: 1; overflow: auto; padding: 12px; }
.er-floating-content > img { display: block; max-width: 100%; height: auto; margin: auto; }
.er-floating-content > iframe { width: 100%; height: calc(100% - 35px); min-height: 200px; border: 0; }
.er-floating-content .er-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.er-detail { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 8px; }
.er-detail dt { font-weight: 600; }
.er-detail dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .reimbursements select, .reimbursements select option { font-size: 14px; }
  .reimbursements .er-project-option, .reimbursements .er-payee-option { font-size: 14px; }
  .reimbursements .er-toolbar { align-items: stretch; }
  .reimbursements .er-toolbar > input, .reimbursements .er-toolbar > select { width: 100%; }
  .reimbursements button { min-height: 0; }
  .reimbursements .er-form { padding: 10px; }
  .reimbursements .er-table:not(.er-table-compact) .er-col-applicant_name { position: static; }
  .reimbursements .er-table:not(.er-table-compact) .er-col-claim_number { min-width: 100px; }
  .er-floating { top: 3vh; height: 88vh; }
}
.reimbursements .er-fuel { margin: 10px 0; padding: 8px 10px; border: 1px solid #c3ced6; border-radius: 6px; background: #fafcfd; }
.reimbursements .er-fuel summary { cursor: pointer; font-weight: 600; }
.reimbursements .er-fuel-row { display: grid; grid-template-columns: 150px minmax(120px, 1fr) 110px 80px auto; gap: 6px; align-items: center; margin: 6px 0; }
.reimbursements .er-fuel-amount { text-align: right; font-variant-numeric: tabular-nums; }
.reimbursements .er-fuel-summary { margin: 6px 0 0; font-weight: 600; }
@media (max-width: 640px) { .reimbursements .er-fuel-row { grid-template-columns: 1fr 1fr; } .reimbursements .er-fuel-row input[type=text] { grid-column: 1 / -1; } }
.er-fuel[hidden] { display: none; }

/* 員工進入畫面：步驟、主要動作、狀態篩選 */
.reimbursements .er-start { margin: 12px 0; padding: 14px 16px; border: 2px dashed #c9d3da; border-radius: 10px; background: #fbfcfd; }
.reimbursements .er-start.er-dragover { border-color: var(--accent, #c26e2c); background: #fff6ec; }
.reimbursements .er-steps { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 12px; padding-left: 20px; font-weight: 600; color: #33505f; }
.reimbursements .er-start-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reimbursements .er-start-action { display: flex; align-items: center; justify-content: center; min-height: 56px; margin: 0; padding: 10px; border: 1px solid #7d8c97; border-radius: 8px; font-size: 16px; font-weight: 600; text-align: center; cursor: pointer; }
.reimbursements label.er-start-action { position: relative; flex-direction: column; }
.reimbursements .er-start-action input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.reimbursements .er-start-action:focus-within { outline: 3px solid var(--accent, #c26e2c); outline-offset: 1px; }
.reimbursements .er-start-note { margin: 10px 0 0; color: #5c4a1a; font-size: 14px; }
.reimbursements .er-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.reimbursements .er-chip { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: baseline; min-width: 120px; padding: 8px 12px; text-align: left; border: 1px solid #cfd8de; border-radius: 8px; background: white; }
.reimbursements .er-chip:hover { background: #f3f7fa; }
.reimbursements .er-chip strong { justify-self: end; font-size: 18px; }
.reimbursements .er-chip small { grid-column: 1 / -1; color: #55646e; }
.reimbursements .er-chip[aria-pressed="true"], .reimbursements .er-chip[aria-pressed="true"]:hover { background: #fff3e6; border-color: var(--accent, #c26e2c); box-shadow: inset 0 0 0 1px var(--accent, #c26e2c); }
.reimbursements .er-table-compact th, .reimbursements .er-table-compact td { min-width: 90px; }
.reimbursements .er-table-compact .er-col-select { min-width: 52px; width: 52px; }
.reimbursements .er-table-compact .er-col-voucher_date, .reimbursements .er-table .er-col-updated_at { white-space: nowrap; }
.reimbursements .er-table-compact .er-col-claim_amount, .reimbursements .er-table-compact .er-col-total_amount { text-align: right; font-variant-numeric: tabular-nums; }

/* 浮動視窗：拖曳標題列移動、拉右下角縮放、放大／還原 */
.er-floating.er-wide { top: 7vh; width: min(1080px, 94vw); height: min(780px, 86vh); }
.er-floating.er-maximized { top: 0 !important; left: 0 !important; transform: none !important; margin: 0 !important; width: 100vw !important; height: 100vh !important; height: 100dvh !important; max-width: 100vw; max-height: 100dvh; border-radius: 0; resize: none; }
.er-floating.er-maximized .er-floating-head { cursor: default; }
.er-floating-controls { display: flex; flex-shrink: 0; gap: 6px; }
.er-floating .er-form { border: 0; padding: 0; margin: 0; }
.er-floating .er-window-status { margin: 0 0 6px; }
.er-floating .er-window-status:empty { display: none; }
.er-backdrop { position: fixed; inset: 0; background: #0b1c2a66; }
.er-review-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.er-review-head strong { overflow-wrap: anywhere; }
.er-review-notes p { margin: 8px 0; }
.er-review-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; align-items: start; }
.er-review-preview { position: sticky; top: 0; max-height: 60vh; overflow: auto; border: 1px solid #d1d9dc; border-radius: 8px; background: #f3f5f6; }
.er-review-preview img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.er-review-preview.er-zoom img { width: 220%; max-width: none; cursor: zoom-out; }
.er-review-preview iframe { width: 100%; height: 58vh; border: 0; }
.er-floating .er-review-actions { position: sticky; bottom: -12px; z-index: 25; margin: 12px -12px -12px; padding: 10px 12px; background: white; border-top: 1px solid #d1d9dc; }
.reimbursements .er-review-actions .er-primary, .reimbursements .er-review-actions .er-primary:hover { background: var(--accent, #c26e2c); border-color: var(--accent, #c26e2c); color: white; font-weight: 600; }
.reimbursements .er-query-search, .reimbursements .er-query-search:hover { background: var(--accent, #c26e2c); border-color: var(--accent, #c26e2c); color: white; font-weight: 600; }
.er-query-filters label { flex: 1 1 150px; }
.er-query-filters label:first-child { flex-basis: 260px; }

@media (max-width: 760px) {
  .er-review-layout { grid-template-columns: minmax(0, 1fr); }
  .er-review-preview { position: static; max-height: 34vh; }
}
@media (max-width: 600px) {
  .reimbursements .er-start-actions { grid-template-columns: minmax(0, 1fr); }
  .reimbursements .er-steps { flex-direction: column; }
  .reimbursements .er-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reimbursements .er-chip { min-width: 0; padding: 6px 8px; }
  .reimbursements .er-table.er-table-compact { display: block; width: 100%; min-width: 0; }
  .reimbursements .er-table-compact thead { display: none; }
  .reimbursements .er-table-compact tbody { display: block; }
  .reimbursements .er-table-compact tr { display: block; padding: 8px 4px; border-bottom: 6px solid #eef2f4; }
  .reimbursements .er-table.er-table-compact td { display: flex; gap: 10px; width: auto; min-width: 0; max-width: none; padding: 3px 8px; border: 0; text-align: left; }
  .reimbursements .er-table-compact td::before { content: attr(data-label); flex: 0 0 5.5em; color: #5a6a75; }
  .reimbursements .er-table-compact td[colspan]::before { content: none; }
  .er-floating, .er-floating.er-wide { top: 0; left: 0; transform: none; margin: 0 !important; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; border-radius: 0; }
}
