.payroll-report-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.payroll-report-open {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(140px, 1.1fr) repeat(5, minmax(88px, 1fr));
  align-items: center;
  gap: 12px;
  border-color: var(--line);
  text-align: left;
}

.payroll-report-open:hover {
  transform: none;
}

.payroll-report-open span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-report-dialog {
  width: calc(100vw - 24px) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100svh - 32px);
  margin: auto;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  padding: 0;
  overflow: hidden;
}

.payroll-report-dialog-shell {
  width: 100%;
  max-height: calc(100svh - 32px);
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  padding: 18px 20px;
  overflow: auto;
}

.payroll-buyer-history-dialog {
  width: min(1400px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100svh - 32px);
  margin: auto;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
  padding: 0;
  overflow: hidden;
}

.payroll-buyer-history-shell {
  width: 100%;
  max-height: calc(100svh - 32px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: 18px 20px;
  overflow: auto;
}

.payroll-buyer-history-totals {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.payroll-buyer-history-totals div {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  padding: 8px;
}

.payroll-buyer-history-totals span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.payroll-buyer-history-totals strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  white-space: nowrap;
}

.payroll-buyer-history-table-wrap {
  max-height: none;
  min-height: min(560px, calc(100svh - 260px));
}

.payroll-buyer-history-table-wrap table {
  table-layout: fixed;
  font-size: 13px;
}

.payroll-buyer-history-table-wrap th:nth-child(1) {
  width: 14%;
}

.payroll-buyer-history-table-wrap th:nth-child(9) {
  width: 7%;
}

.payroll-buyer-history-table-wrap th:nth-child(10) {
  width: 22%;
}

.payroll-history-delta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payroll-history-delta .positive {
  color: #047857;
}

.payroll-history-delta .negative {
  color: #b91c1c;
}

.payroll-employee-dialog .payroll-employee-form {
  grid-template-columns: 1fr;
}

.payroll-dialog-section[hidden],
.payroll-employee-form label[hidden] {
  display: none !important;
}

.payroll-dialog-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.payroll-dialog-section h3 {
  margin: 0;
  font-size: 14px;
}

.payroll-check-option {
  min-height: 36px;
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
  text-transform: none !important;
}

.payroll-check-option input {
  width: auto;
  min-height: auto;
}

.payroll-section-toggle {
  font-weight: 900 !important;
}

.payroll-mentor-fields {
  display: grid;
  gap: 10px;
}

.payroll-mentor-fields[hidden] {
  display: none;
}

.payroll-mentor-buyer-list {
  max-height: 180px;
  display: grid;
  gap: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 8px;
}

.payroll-mentor-selected-list {
  display: grid;
  gap: 8px;
}

.payroll-mentor-selected-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.payroll-mentor-selected-items {
  display: grid;
  gap: 6px;
}

.payroll-mentor-selected-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 6px 8px;
}

.payroll-mentor-selected-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payroll-buyer-option {
  min-height: 34px;
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
  text-transform: none !important;
}

.payroll-buyer-option input {
  width: auto;
  min-height: auto;
}
