/* Desktop reporting: one process context, one personnel table. */
@media (min-width: 821px) {
  #reporting-view .reporting-entry-panel { flex: 1 1 0; min-height: 0; display: flex; }
  #reporting-view .report-table-form { display: flex; flex: 1 1 0; flex-direction: column; min-height: 0; width: 100%; }
  .report-table-form .report-context-section { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 1fr) 168px; align-items: end; flex: 0 0 auto; gap: 12px 16px; padding: 20px 24px 16px; border-right: 0; border-bottom: 1px solid var(--line); background: var(--surface); overflow: visible; }
  .report-table-form .report-context-section:has(.report-product-field) { grid-template-columns: minmax(210px, 1.3fr) minmax(180px, 1.3fr) minmax(145px, 1fr) 168px; }
  .report-table-form #report-target-fields { display: contents; }
  .report-table-form .report-context-section > label { margin: 0; }
  .report-table-form .report-order-field { grid-column: 1; grid-row: 1; }
  .report-table-form .report-product-field { grid-column: 2; grid-row: 1; }
  .report-table-form .report-process-field { grid-column: -3 / -2; grid-row: 1; }
  .report-table-form .report-date-field { grid-column: -2 / -1; grid-row: 1; max-width: none; }
  .report-table-form .report-selected-context { grid-column: 1 / -1; display: flex; gap: 16px; align-items: center; justify-content: space-between; min-width: 0; }
  .report-table-form .report-selected-context:empty { display: none; }
  .report-table-form .report-product-context { min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 12px; }
  .report-table-form .report-product-context strong { font-size: 13px; font-weight: 600; }
  .report-table-form .report-product-context span { color: var(--text-secondary); overflow-wrap: anywhere; }
  .report-table-form .report-product-context small { color: var(--muted); font-size: 12px; }
  .report-table-form .report-quantity-fields { display: block; flex-shrink: 0; }
  .report-table-form .report-quantity-fields label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
  .report-table-form .report-quantity-fields label > input { width: 145px; flex: 0 0 145px; min-height: 32px; height: 32px; font-size: 12px; }
  .report-table-form .report-context-note { grid-column: 1 / -1; margin: 0; }
  .report-table-form .report-people-section { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; padding: 0; overflow: hidden; container-type: normal; }
  .report-personnel-toolbar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; padding: 16px 24px; }
  .report-fill-controls { display: flex; gap: 8px; align-items: center; }
  .report-table-form .report-fill-controls label { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
  .report-table-form .report-fill-controls label > input { width: 76px; flex: 0 0 76px; text-align: center; }
  .report-personnel-scroll { overflow: auto; overscroll-behavior: contain; flex: 1 1 0; min-height: 130px; margin: 0 24px; scrollbar-gutter: stable; }
  .report-personnel-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
  .report-personnel-table .report-check-col { width: 44px; }
  .report-personnel-table .report-name-col { width: 24%; }
  .report-personnel-table .report-hours-col { width: 144px; }
  .report-personnel-table .report-day-col { width: 155px; }
  .report-personnel-table .report-action-col { width: 54px; }
  .report-personnel-table :is(th, td) { text-align: center; vertical-align: middle; padding: 6px 10px; border-bottom: 1px solid var(--line); }
  .report-personnel-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-soft); color: var(--text-soft); height: 40px; font-size: 12px; font-weight: 600; white-space: nowrap; }
  .report-personnel-table td { height: 47px; font-variant-numeric: tabular-nums; }
  .report-personnel-table tr.is-selected td { background: rgb(var(--hongyu-accent-rgb) / 7%); }
  .report-table-form .report-personnel-table td input[name=hours] { width: 88px; min-height: 32px; height: 32px; padding: 4px 8px; text-align: center; }
  .report-table-form .report-personnel-table td input[name=remark] { width: 100%; min-height: 32px; height: 32px; padding: 4px 8px; }
  .report-personnel-table .entry-employee { overflow-wrap: anywhere; }
  .report-personnel-table .entry-employee small { display: inline; margin-left: 8px; color: var(--muted); font-size: 12px; }
  .report-personnel-table .input-error { outline: 1px solid var(--danger); outline-offset: -1px; }
  .report-table-form input[type=checkbox] { width: 16px; height: 16px; min-height: 16px; padding: 0; margin: 0; vertical-align: middle; accent-color: var(--accent); }
  .report-table-form [hidden] { display: none !important; }
  .report-people-empty { color: var(--muted); text-align: center; padding: 48px 16px; font-size: 13px; }
  .report-table-form .report-submit-bar { flex: 0 0 auto; justify-content: space-between; gap: 16px; }
  .report-table-form .report-submit-bar .entry-summary { margin: 0; padding: 0; font-size: 12px; font-weight: 500; }
  .report-table-form .report-duplicate-warning { flex-shrink: 0; max-height: 155px; overflow: auto; margin: 8px 24px; }
  .report-table-form .report-employee-dialog { color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; padding: 0; width: min(620px, calc(100vw - 80px)); max-height: min(680px, calc(100dvh - 80px)); box-shadow: 0 20px 60px rgb(var(--shadow-rgb) / 20%); }
  .report-employee-dialog[open] { display: flex; flex-direction: column; }
  .report-employee-dialog::backdrop { background: var(--scrim); }
  .report-employee-dialog header, .report-employee-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; flex-shrink: 0; }
  .report-employee-dialog header { border-bottom: 1px solid var(--line); }
  .report-employee-dialog h2 { font-size: 17px; font-weight: 600; margin: 0; }
  .report-picker-filters { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; padding: 16px 20px 12px; }
  .report-table-form .report-picker-select-all { display: flex; gap: 10px; align-items: center; padding: 0 20px 10px; }
  .report-picker-list { overflow: auto; min-height: 100px; max-height: 360px; padding: 0 12px; overscroll-behavior: contain; }
  .report-table-form .report-picker-person { display: grid; grid-template-columns: 20px minmax(0, 1fr) 110px; gap: 10px; align-items: center; min-height: 43px; padding: 8px 8px; border-radius: 6px; cursor: pointer; }
  .report-picker-person:hover, .report-picker-person:has(input:checked) { background: rgb(var(--hongyu-accent-rgb) / 7%); }
  .report-picker-person span { color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
  .report-picker-person small { color: var(--muted); font-size: 12px; font-weight: 400; }
  .report-picker-person span small { margin-left: 8px; }
  .report-picker-person > small { text-align: right; }
  .report-picker-empty { color: var(--muted); text-align: center; padding: 24px; font-size: 12px; }
  .report-employee-dialog footer { border-top: 1px solid var(--line); font-size: 12px; }
}

/* Report identity and date share the final column; L1 only sees the date. */
.report-table-form .report-meta-fields { grid-column: -2 / -1; grid-row: 1; display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; gap: 16px; }
.report-table-form .report-meta-fields:has(.report-reporter-field) { grid-template-columns: minmax(0, 1fr) 168px; }
.report-table-form .report-meta-fields > label { margin: 0; min-width: 0; }
.report-table-form .report-meta-fields .report-date-field { grid-column: auto; grid-row: auto; }
.report-table-form .report-context-section:has(.report-reporter-field) { grid-template-columns: minmax(210px, 1.6fr) minmax(160px, 1fr) 336px; }
.report-table-form .report-context-section:has(.report-reporter-field):has(.report-product-field) { grid-template-columns: minmax(210px, 1.3fr) minmax(180px, 1.3fr) minmax(145px, 1fr) 336px; }
.report-personnel-table [data-report-day-total].is-over { color: var(--warning); font-weight: 600; }
