.termination-batch-modal {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
}
.page-heading:has(.termination-batch-launch) {
  position: relative;
  padding-right: 270px;
}
.termination-batch-launch {
  position: absolute;
  right: 0;
  top: 5px;
}
.termination-batch-modal > header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ui-surface);
}
.termination-batch-content {
  min-width: 0;
  color: var(--ui-ink);
}
.termination-review-summary > .empty-state,
.termination-group > .empty-state,
.termination-batch-modal .contract-batch-selection > .empty-state {
  min-height: 0;
  padding: 12px 16px;
  margin-block: 12px;
  text-align: left;
  line-height: 1.6;
  background: var(--ui-soft);
  border-radius: var(--ui-radius-control);
}
.termination-groups {
  display: grid;
  gap: 18px;
  margin-block: 20px;
}
.termination-group {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-panel);
}
.termination-group legend {
  padding-inline: 8px;
  color: var(--ui-brand-text);
  font-weight: 600;
}
.termination-group > .button {
  margin-top: 12px;
}
.termination-group-fields {
  display: grid;
  grid-template-columns:
    minmax(140px, 0.85fr) minmax(0, 1.4fr) minmax(0, 1.5fr)
    minmax(180px, 1fr);
  align-items: start;
  gap: 16px;
}
.termination-group-fields:has(> .field:last-child[hidden]) {
  grid-template-columns: minmax(140px, 0.85fr) minmax(0, 1.4fr) minmax(0, 2.5fr);
}
.termination-group-fields .field > span {
  display: flex;
  align-items: flex-end;
  min-height: 2.8em;
  line-height: 1.4;
}
.termination-group-fields [hidden] {
  display: none;
}
.termination-group-fields textarea {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  resize: vertical;
}
.termination-actions,
.termination-group-toolbar,
.termination-group-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.termination-actions {
  justify-content: flex-end;
  margin-top: 20px;
}
.termination-group-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}
.termination-group-toolbar p {
  margin-block: 5px 0;
  color: var(--ui-muted);
}
.termination-group-tabs {
  margin-bottom: 18px;
}
.termination-table-wrap {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-panel);
}
.termination-review-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}
.termination-review-table th,
.termination-review-table td {
  padding: 13px 15px;
  text-align: left;
  border-bottom: 1px solid var(--ui-line);
  vertical-align: top;
}
.termination-review-table th {
  position: sticky;
  top: 0;
  color: var(--ui-info);
  background: var(--ui-soft);
  font-weight: 500;
}
.termination-review-table td {
  overflow-wrap: anywhere;
}
.termination-review-table th:nth-child(1) {
  width: 17%;
}
.termination-review-table th:nth-child(2) {
  width: 11%;
}
.termination-review-table th:nth-child(3) {
  width: 22%;
}
.termination-review-table th:nth-child(4) {
  width: 10%;
}
.termination-review-table th:nth-child(5) {
  width: 29%;
}
.termination-review-table th:nth-child(6) {
  width: 11%;
}
.termination-review-table small {
  display: block;
  margin-top: 5px;
  color: var(--ui-muted);
}
.termination-batch-modal .contract-batch-selection {
  min-width: 0;
}
.termination-group-tabs {
  display: block;
}
.termination-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 12px;
  margin-block: 16px;
}
.termination-group-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-panel);
  background: var(--ui-surface);
}
.termination-group-card[aria-current="step"] {
  border-color: var(--ui-brand);
  box-shadow: inset 0 3px var(--ui-brand);
}
.termination-group-card summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}
.termination-group-card summary::-webkit-details-marker {
  display: none;
}
.termination-group-card summary:focus-visible {
  outline: 2px solid var(--ui-brand);
  outline-offset: 5px;
  border-radius: 4px;
}
.termination-card-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--ui-brand-text);
  background: var(--ui-soft);
}
.termination-card-heading {
  display: grid;
  gap: 3px;
  flex: 1;
  font-size: 13px;
}
.termination-card-heading > span {
  color: var(--ui-muted);
  font-size: 12px;
}
.termination-count {
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--ui-soft);
  color: var(--ui-info);
  font-size: 11px;
  white-space: nowrap;
}
.termination-expand {
  display: flex;
  color: var(--ui-muted);
}
.termination-expand svg {
  width: 16px;
  height: 16px;
}
.termination-group-card details[open] .termination-expand {
  transform: rotate(90deg);
}
.termination-card-cause {
  margin: 14px 0 6px;
  font-size: 12px;
  line-height: 1.6;
}
.termination-card-status {
  margin: 0 0 12px;
  color: var(--ui-muted);
  font-size: 11px;
}
.termination-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.termination-card-actions .button {
  flex: 1;
  font-size: 11px;
}
.termination-group-members {
  padding-top: 10px;
}
.termination-group-members p {
  color: var(--ui-muted);
  font-size: 11px;
}
.termination-group-members ul {
  max-height: 180px;
  overflow: auto;
  list-style: none;
  padding: 0;
  margin: 0;
}
.termination-group-members li {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-top: 1px solid var(--ui-line);
  font-size: 12px;
}
.termination-group-members small {
  color: var(--ui-muted);
}
.termination-readiness {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-panel);
  background: var(--ui-soft);
}
.termination-readiness > div {
  flex: 1 1 280px;
}
.termination-readiness strong {
  font-size: 14px;
}
.termination-readiness p {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ui-muted);
}
.termination-readiness.has-pending {
  background: var(--ui-warning-bg);
  border-color: var(--ui-warning);
}
.termination-readiness.has-pending .termination-card-icon {
  color: var(--ui-warning);
  background: var(--ui-warning-bg);
}
.termination-readiness .button {
  font-size: 12px;
}
.termination-ready-label,
.termination-pending-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.termination-ready-label {
  color: var(--ui-success);
}
.termination-pending-label {
  color: var(--ui-warning);
}
.termination-ready-label svg,
.termination-pending-label svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.termination-review-table tr.needs-review {
  background: var(--ui-warning-bg);
}
.termination-review-table tr.needs-review td:first-child {
  box-shadow: inset 3px 0 var(--ui-warning);
}
.termination-problem {
  margin-top: 10px;
  line-height: 1.6;
}
.termination-problem strong {
  font-size: 12px;
  font-weight: 500;
}
.termination-problem p {
  margin: 5px 0 0;
  color: var(--ui-muted);
  font-size: 11px;
}
.termination-row-actions .button,
.termination-row-review .button {
  font-size: 11px;
  min-width: 0;
  white-space: normal;
  padding: 7px 9px;
}
.termination-row-actions svg {
  width: 14px;
  height: 14px;
}
.termination-review-table .termination-row-actions {
  padding-inline: 8px;
}
.termination-row-actions .button {
  white-space: nowrap;
}
.termination-row-actions .button-label {
  overflow-wrap: normal;
}
.termination-row-review .button {
  margin-top: 10px;
}
.termination-discard-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--ui-soft);
  border-radius: var(--ui-radius-control);
  font-size: 12px;
}
.termination-inline-editor {
  padding: 18px;
  margin-block: 16px;
  border: 1px solid var(--ui-brand);
  border-radius: var(--ui-radius-panel);
}
.termination-inline-editor > header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.termination-inline-editor h4 {
  margin: 0;
  font-size: 14px;
}
.termination-inline-editor p {
  margin: 6px 0 0;
  color: var(--ui-muted);
  font-size: 12px;
}
@media (max-width: 760px) {
  .termination-review-table,
  .termination-review-table tbody,
  .termination-review-table tr,
  .termination-review-table td {
    display: block;
    width: auto;
  }
  .termination-review-table thead {
    display: none;
  }
  .termination-review-table tr + tr {
    border-top: 2px solid var(--ui-line);
  }
  .termination-review-table td {
    padding: 8px 14px;
    border: 0;
  }
  .termination-review-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ui-muted);
  }
  .termination-review-table td:first-child {
    padding-top: 14px;
  }
  .termination-review-table td:last-child {
    padding-bottom: 14px;
  }
  .termination-review-table tr.needs-review td:first-child {
    box-shadow: none;
  }
  .termination-review-table tr.needs-review {
    border-left: 3px solid var(--ui-warning);
  }
  .termination-table-wrap {
    max-height: 60vh;
  }
  .termination-readiness {
    align-items: flex-start;
  }
  .termination-readiness > div {
    flex-basis: calc(100% - 50px);
  }
  .termination-readiness > .button {
    width: 100%;
  }
}
@media (max-width: 1000px) {
  .termination-group-fields,
  .termination-group-fields:has(> .field:last-child[hidden]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .termination-group-fields .field > span {
    min-height: 0;
  }
  .termination-group-fields textarea {
    height: 86px;
  }
}
@media (max-width: 640px) {
  .termination-batch-modal {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }
  .termination-group {
    padding: 12px;
  }
  .termination-group-fields,
  .termination-group-fields:has(> .field:last-child[hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }
  .termination-actions > .button {
    flex: 1 1 100%;
  }
  .termination-group-toolbar > .button,
  .termination-group-tabs .button {
    max-width: 100%;
    white-space: normal;
  }
}
@media (max-width: 760px) {
  .page-heading:has(.termination-batch-launch) {
    padding-right: 0;
  }
  .termination-batch-launch {
    position: static;
    margin-top: 18px;
  }
}

/* Retry of failed workers, grouped by reason. */
.report-retry-reasons {
  margin: 12px 0 16px;
}
.report-retry-reasons h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ui-ink);
}
.report-retry-reasons > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.report-retry-reasons details {
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-panel);
  padding: 10px 14px;
  background: var(--ui-surface);
}
.report-retry-reasons summary {
  cursor: pointer;
  overflow-wrap: anywhere;
}
.report-retry-reasons summary strong {
  color: var(--ui-brand-text);
}
.report-retry-reasons details ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--ui-muted);
}
.report-retry-host .button {
  margin-top: 12px;
}

/* Per-employee values from Excel inside the termination batch. */
.termination-excel-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px dashed var(--ui-line);
  border-radius: var(--ui-radius-panel);
  background: var(--ui-soft);
}
.termination-excel-entry p {
  margin: 4px 0 0;
  color: var(--ui-muted);
}
.termination-excel-steps {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.termination-excel-steps > li {
  padding: 18px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius-panel);
}
.termination-excel-steps .button,
.termination-excel-steps .contract-bulk-file {
  margin-top: 10px;
}
.termination-excel-feedback {
  min-height: 1.4em;
  margin: 8px 0;
}
.termination-excel-feedback.is-error,
.termination-excel-table .is-error {
  color: var(--ui-danger, var(--ui-danger));
}
.termination-excel-table small {
  display: block;
  margin-top: 4px;
}
@media (max-width: 720px) {
  .termination-excel-entry {
    flex-direction: column;
    align-items: stretch;
  }
  .termination-excel-steps {
    grid-template-columns: 1fr;
  }
}
.termination-excel-table th:nth-child(1) {
  width: 7%;
}
.termination-excel-table th:nth-child(2) {
  width: 20%;
}
.termination-excel-table th:nth-child(3) {
  width: 13%;
}
.termination-excel-table th:nth-child(4) {
  width: 22%;
}
.termination-excel-table th:nth-child(5) {
  width: 12%;
}
.termination-excel-table th:nth-child(6) {
  width: 26%;
}
