/* Compact payroll document. Uses the console's existing theme tokens. */
#payrollDetailModal .payroll-statement { max-width: 940px; width: calc(100% - 24px); padding: 20px; }
#payrollDetailModal .page-header { align-items: center; gap: 12px; padding: 0 !important; position: static; min-height: 0; }
.payroll-statement .ps-note { font-size: 12px; color: var(--text-muted); margin: 6px 0 12px; line-height: 1.5; }
.ps-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 16px 0; border-block: 1px solid var(--border); }
.ps-totals > div { min-width: 0; }
.ps-totals span, .ps-totals strong, .ps-totals small { display: block; }
.ps-totals span { font-size: 12px; color: var(--text-muted); }
.ps-totals strong { font-size: 23px; margin: 6px 0; font-variant-numeric: tabular-nums; }
.ps-totals small { font-size: 11px; color: var(--text-muted); }
.ps-total-due strong { color: var(--lime); }
.ps-calculation { margin: 12px 0; font-size: 12px; }
.ps-calculation > summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.ps-calculation dl { margin: 8px 0; }
.ps-calculation dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.ps-calculation dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-section { margin: 20px 0; }
.ps-section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ps-section-heading h3 { margin: 0; font-size: 14px; }
.ps-section-heading h3 span { font-size: 12px; color: var(--text-muted); margin-left: 4px; }
.ps-section-heading > strong { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ps-project { border: 1px solid var(--border); border-radius: 10px; margin: 8px 0; overflow: hidden; }
.ps-project > summary { display: flex; align-items: center; gap: 12px; padding: 12px; cursor: pointer; list-style: none; background: var(--surface-2); }
.ps-project > summary::-webkit-details-marker { display: none; }
.ps-project > summary::before { content: '›'; font-size: 20px; color: var(--text-muted); }
.ps-project[open] > summary::before { transform: rotate(90deg); }
.ps-project-identity { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ps-project-identity > strong { font-size: 14px; }
.ps-project-identity > span { font-size: 12px; overflow-wrap: anywhere; }
.ps-project-identity > small, .ps-project-total > small { font-size: 11px; color: var(--text-muted); }
.ps-project-total { text-align: right; flex-shrink: 0; }
.ps-project-total > * { display: block; }
.ps-project-total > strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.ps-project-total > small { margin-top: 4px; }
.ps-project-body { padding: 0 12px 12px; }
.ps-table-wrap { overflow-x: auto; }
.ps-table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12px; }
.ps-table th, .ps-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; }
.ps-table th { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.ps-table .ps-number { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ps-project-foot { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
.ps-payment { display: block; margin-top: 5px; color: var(--text); }
.ps-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ps-empty { padding: 16px; border: 1px dashed var(--border); border-radius: 8px; color: var(--text-muted); }
.ps-section--waiting .ps-project { border-inline-start: 3px solid var(--orange); }
.ps-section--progress .ps-project { border-inline-start: 3px solid var(--blue); }
.payroll-statement summary:focus-visible, .payroll-statement button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
@media (max-width: 600px) {
  #payrollDetailModal .payroll-statement { padding: 16px; }
  .ps-totals { grid-template-columns: 1fr; gap: 12px; }
  .ps-totals > div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; }
  .ps-totals small { grid-column: 1 / -1; }
  .ps-totals strong { font-size: 20px; }
  .ps-project > summary { gap: 8px; padding: 10px; }
  .ps-section-heading { flex-wrap: wrap; }
}

#payrollDetailModal .page-title { font-size: 22px; margin: 0; }
#pdStatementPeriod { margin: 0 0 4px; }

/* One project, one amount; explanations are available on hover and expansion. */
.ps-compact-list { border: 1px solid var(--border); border-radius: 10px; margin-top: 12px; }
.ps-list-heading { display: grid; grid-template-columns: minmax(0,1fr) 130px 110px; gap: 12px; padding: 8px 12px 8px 35px; font-size: 11px; color: var(--text-muted); }
.ps-list-heading > :last-child { text-align: right; }
.ps-compact-list .ps-project { border: 0; border-top: 1px solid var(--border); border-radius: 0; margin: 0; overflow: visible; }
.ps-compact-list .ps-project > summary { padding: 10px 12px; min-height: 44px; box-sizing: border-box; background: transparent; }
.ps-compact-list .ps-project > summary:hover, .ps-compact-list .ps-project > summary:focus-visible { background: var(--surface-2); }
.ps-compact-identity { display: flex; gap: 10px; align-items: baseline; flex: 1; min-width: 0; font-size: 13px; }
.ps-compact-identity > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-muted); font-size: 12px; }
.ps-status { width: 130px; flex-shrink: 0; font-size: 12px; }
.ps-status--waiting { color: var(--orange); }
.ps-status--progress { color: var(--blue); }
.ps-compact-amount { width: 110px; text-align: right; flex-shrink: 0; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media(max-width:600px) {
 .ps-list-heading { grid-template-columns: minmax(0,1fr) 100px 90px; }
 .ps-status { width: 100px; font-size: 11px; }
 .ps-compact-amount { width: 90px; font-size: 12px; }
 .ps-compact-identity { flex-direction: column; gap: 2px; }
}

.ps-compact-list summary { position: relative; }
.ps-hover-detail { display: none; position: absolute; z-index: 10; left: 12px; right: 12px; bottom: calc(100% - 2px); padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2, #25232a); color: var(--text); font-size: 12px; font-weight: 400; line-height: 1.5; box-shadow: 0 6px 20px #0004; }
.ps-compact-list summary:hover .ps-hover-detail,
.ps-compact-list summary:focus-visible .ps-hover-detail { display: block; }
.ps-compact-list details[open] .ps-hover-detail { display: none; }
