.document-row.pcs-has-remove {
  grid-template-columns: 40px minmax(0, 1fr) auto auto auto;
}

.pcs-remove-document {
  color: #95502f;
  border-color: #ecd2c3;
  background: #fffaf7;
}

.pcs-remove-document:hover:not(:disabled) {
  border-color: #d9ab92;
  background: #fff2ea;
}

.pcs-start-period {
  color: #6c4a30;
}

.drop-zone.pcs-drag-active {
  border-color: #4e9293;
  background: #eaf6f4;
  box-shadow: inset 0 0 0 2px rgba(78, 146, 147, 0.16);
}

.drop-zone.pcs-drag-active .upload-mark {
  transform: translateY(-3px) scale(1.05);
}

.pcs-review-safety {
  max-width: 660px;
  padding: 12px 14px;
  border: 1px solid #ead7b8;
  border-radius: 10px;
  color: #6d4a22;
  background: #fff8ec;
  line-height: 1.45;
}

.pcs-review-safety strong {
  display: block;
  margin-bottom: 2px;
}

.pcs-staffing-legacy-hidden {
  display: none !important;
}

.pcs-staffing-review {
  overflow: hidden;
}

.pcs-staffing-heading h2 {
  margin: 5px 0 0;
}

.pcs-staffing-state {
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 8px;
  font-weight: 800;
}

.pcs-staffing-state.ready {
  color: var(--green);
  background: var(--green-pale);
}

.pcs-staffing-state.imported {
  color: var(--teal-deep);
  background: var(--teal-pale);
}

.pcs-staffing-safety {
  color: #4b6d62;
  background: linear-gradient(120deg, #edf7f2, #f4faf8);
  border-bottom: 1px solid #dbe9e3;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 18px;
  display: flex;
}

.pcs-staffing-safety-mark {
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 11px;
  font-weight: 900;
  display: grid;
}

.pcs-staffing-safety strong {
  color: #3f6256;
  font-size: 10px;
}

.pcs-staffing-safety p {
  margin: 4px 0 0;
  font-size: 9px;
  line-height: 1.5;
}

.pcs-staffing-warnings {
  border-radius: 10px;
  margin: 14px 18px;
  padding: 12px 14px;
}

.pcs-staffing-warnings.has-warnings {
  color: #775a32;
  background: var(--amber-pale);
}

.pcs-staffing-warnings.clear {
  color: #50715a;
  background: var(--green-pale);
}

.pcs-staffing-warnings strong {
  font-size: 10px;
}

.pcs-staffing-warnings p,
.pcs-staffing-warnings ul {
  margin: 5px 0 0;
  font-size: 9px;
  line-height: 1.5;
}

.pcs-staffing-warnings ul {
  padding-left: 18px;
}

.pcs-staffing-metrics {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  display: grid;
}

.pcs-staffing-metric {
  border-right: 1px solid var(--line);
  min-width: 0;
  padding: 13px 16px;
}

.pcs-staffing-metric:last-child {
  border-right: 0;
}

.pcs-staffing-metric span,
.pcs-staffing-metric strong,
.pcs-staffing-metric small {
  display: block;
}

.pcs-staffing-metric span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 8px;
  font-weight: 750;
}

.pcs-staffing-metric strong {
  overflow-wrap: anywhere;
  margin-top: 4px;
  font-family: Fraunces, Georgia, serif;
  font-size: 17px;
  font-weight: 520;
}

.pcs-staffing-metric small {
  color: #969d9c;
  margin-top: 3px;
  font-size: 8px;
}

.pcs-staffing-table-wrap {
  width: 100%;
  max-height: 620px;
  overflow: auto;
}

.pcs-staffing-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1290px;
}

.pcs-staffing-table th {
  color: #848b8a;
  border-bottom: 1px solid var(--line);
  text-align: left;
  text-transform: uppercase;
  background: #fbfcfb;
  padding: 9px 10px;
  font-size: 8px;
  position: sticky;
  top: 0;
  z-index: 1;
}

.pcs-staffing-table td {
  vertical-align: top;
  border-bottom: 1px solid #edf0ef;
  padding: 9px 10px;
  font-size: 9px;
}

.pcs-staffing-table tr:has(.pcs-staffing-check:not(:checked)) {
  opacity: .56;
  background: #fafafa;
}

.pcs-staffing-table input:not([type="checkbox"]),
.pcs-staffing-table select {
  color: var(--ink);
  background: #fff;
  border: 1px solid #dce3e1;
  border-radius: 7px;
  outline: 0;
  height: 32px;
  padding: 0 7px;
  font-size: 9px;
}

.pcs-staffing-table input:focus,
.pcs-staffing-table select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-pale);
}

.pcs-staffing-table td small {
  color: #8d9493;
  margin-top: 4px;
  font-size: 8px;
  display: block;
}

.pcs-staffing-use {
  text-align: center;
}

.pcs-staffing-check {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
}

.pcs-staffing-date { width: 118px; }
.pcs-staffing-clinician { width: 155px; }
.pcs-staffing-role { width: 92px; }
.pcs-staffing-unit { width: 105px; }
.pcs-staffing-shift { width: 92px; }
.pcs-staffing-hours { width: 72px; }
.pcs-staffing-status { width: 100px; }

.pcs-staffing-id {
  max-width: 150px;
  overflow-wrap: anywhere;
}

.pcs-staffing-flags {
  max-width: 235px;
}

.pcs-staffing-flag {
  color: #845b2e;
  background: var(--amber-pale);
  border-radius: 5px;
  margin: 0 0 4px;
  padding: 4px 6px;
  font-size: 8px;
  display: block;
}

.pcs-staffing-ready {
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
}

.pcs-staffing-actions {
  background: #fbfcfb;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 18px;
  display: flex;
}

.pcs-staffing-actions p {
  max-width: 720px;
  color: var(--muted);
  margin: 0;
  font-size: 9px;
  line-height: 1.5;
}

.pcs-staffing-actions p strong {
  color: var(--ink);
}

.pcs-staffing-message {
  border-top: 1px solid;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 9px;
  display: flex;
}

.pcs-staffing-message strong {
  white-space: nowrap;
}

.pcs-staffing-message.success {
  color: #45684e;
  background: var(--green-pale);
  border-color: #cfe2d3;
}

.pcs-staffing-message.warning {
  color: #775a32;
  background: var(--amber-pale);
  border-color: #ead7b8;
}

.pcs-staffing-message.error {
  color: #8b4a2f;
  background: #fff0e7;
  border-color: #efcfbf;
}

.pcs-staffing-message button {
  flex: none;
  margin-left: auto;
}

.pcs-staffing-next-step {
  color: #315f5e;
  background: linear-gradient(110deg, #e4f3f1, #f1f8f1);
  border-bottom: 1px solid #cee2df;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 15px 18px;
  display: flex;
}

.pcs-staffing-next-step strong,
.pcs-staffing-next-step p {
  display: block;
}

.pcs-staffing-next-step strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 14px;
  font-weight: 560;
}

.pcs-staffing-next-step p {
  color: #587472;
  max-width: 760px;
  margin: 4px 0 0;
  font-size: 9px;
  line-height: 1.5;
}

.pcs-staffing-next-step button {
  flex: none;
}

.pcs-reconciliation-review {
  overflow: hidden;
}

.pcs-reconciliation-heading h2 {
  margin: 5px 0 0;
}

.pcs-reconciliation-state {
  color: var(--green);
  background: var(--green-pale);
  white-space: nowrap;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 8px;
  font-weight: 800;
}

.pcs-reconciliation-safety {
  color: #3e6963;
  background: linear-gradient(120deg, #e9f6f3, #f5faf4);
  border-bottom: 1px solid #d2e7e2;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 18px;
  display: flex;
}

.pcs-reconciliation-safety-mark {
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  flex: 0 0 24px;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 11px;
  font-weight: 900;
  display: grid;
}

.pcs-reconciliation-safety strong {
  color: #315d58;
  font-size: 10px;
}

.pcs-reconciliation-safety p {
  margin: 4px 0 0;
  font-size: 9px;
  line-height: 1.5;
}

.pcs-reconciliation-metrics {
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(6, minmax(0, 1fr));
  display: grid;
}

.pcs-reconciliation-metrics .pcs-staffing-metric strong {
  font-size: 16px;
}

.pcs-reconciliation-warnings {
  color: #75562f;
  background: var(--amber-pale);
  border-radius: 10px;
  margin: 14px 18px;
  padding: 12px 14px;
}

.pcs-reconciliation-warnings strong {
  font-size: 10px;
}

.pcs-reconciliation-warnings ul {
  margin: 5px 0 0;
  padding-left: 18px;
  font-size: 9px;
  line-height: 1.5;
}

.pcs-reconciliation-table-wrap {
  width: 100%;
  max-height: 650px;
  overflow: auto;
  overscroll-behavior: contain;
}

.pcs-reconciliation-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1580px;
}

.pcs-reconciliation-table th {
  color: #838b89;
  border-bottom: 1px solid var(--line);
  text-align: left;
  text-transform: uppercase;
  background: #fbfcfb;
  padding: 9px 10px;
  font-size: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.pcs-reconciliation-table td {
  vertical-align: top;
  border-bottom: 1px solid #edf0ef;
  padding: 10px;
  font-size: 9px;
}

.pcs-reconciliation-table td > strong,
.pcs-reconciliation-table td > small {
  display: block;
}

.pcs-reconciliation-table td > small {
  color: #8a9290;
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.35;
}

.pcs-reconciliation-row:has(.pcs-reconciliation-check:not(:checked)) {
  background: #fbfbfb;
}

.pcs-reconciliation-row:has(.pcs-reconciliation-check:not(:checked)) > td:not(.pcs-reconciliation-flags) {
  opacity: .68;
}

.pcs-reconciliation-row.needs-review {
  box-shadow: inset 3px 0 0 #e3b367;
}

.pcs-reconciliation-use {
  text-align: center;
}

.pcs-reconciliation-check {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
}

.pcs-reconciliation-table input[type="number"] {
  color: var(--ink);
  background: #fff;
  border: 1px solid #dce3e1;
  border-radius: 7px;
  outline: 0;
  width: 78px;
  height: 32px;
  padding: 0 7px;
  font-size: 9px;
}

.pcs-reconciliation-table input[type="number"]:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-pale);
}

.pcs-reconciliation-table input:disabled {
  color: #999f9e;
  background: #f3f5f4;
}

.pcs-reconciliation-evidence-id {
  max-width: 165px;
  overflow-wrap: anywhere;
}

.pcs-reconciliation-missing {
  color: #9b6737;
  font-weight: 750;
}

.pcs-reconciliation-status strong,
.pcs-reconciliation-status small {
  margin-top: 4px;
  display: block;
}

.pcs-reconciliation-outcome {
  color: #366f61;
  background: var(--green-pale);
  text-transform: capitalize;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 8px;
  font-weight: 800;
  display: inline-block;
}

.pcs-reconciliation-outcome.unmatched,
.pcs-reconciliation-outcome.ambiguous,
.pcs-reconciliation-outcome.inactive-evidence {
  color: #8a5a28;
  background: var(--amber-pale);
}

.pcs-reconciliation-outcome.inactive {
  color: #6e7473;
  background: #eef1f0;
}

.pcs-reconciliation-flags {
  width: 250px;
  max-width: 250px;
}

.pcs-reconciliation-flag {
  color: #845b2e;
  background: var(--amber-pale);
  border-radius: 5px;
  margin: 0 0 4px;
  padding: 4px 6px;
  font-size: 8px;
  line-height: 1.35;
  display: block;
}

.pcs-reconciliation-flag.info {
  color: #376b6b;
  background: var(--teal-pale);
}

.pcs-reconciliation-ready {
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
}

.pcs-reconciliation-actions {
  background: #fbfcfb;
  border-top: 1px solid var(--line);
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 16px 18px;
  display: flex;
}

.pcs-reconciliation-actions p {
  color: var(--muted);
  max-width: 780px;
  margin: 0;
  font-size: 9px;
  line-height: 1.5;
}

.pcs-reconciliation-actions p > strong {
  color: var(--ink);
}

.pcs-reconciliation-selected-summary {
  color: #397272;
  margin-top: 5px;
  display: block;
}

.pcs-reconciliation-message {
  border-top: 1px solid;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-size: 9px;
  display: flex;
}

.pcs-reconciliation-message strong {
  white-space: nowrap;
}

.pcs-reconciliation-message.success {
  color: #45684e;
  background: var(--green-pale);
  border-color: #cfe2d3;
}

.pcs-reconciliation-message.warning {
  color: #775a32;
  background: var(--amber-pale);
  border-color: #ead7b8;
}

.pcs-reconciliation-message.error {
  color: #8b4a2f;
  background: #fff0e7;
  border-color: #efcfbf;
}

.pcs-reconciliation-message button {
  flex: none;
  margin-left: auto;
}

@media (max-width: 760px) {
  .document-row.pcs-has-remove {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .document-row.pcs-has-remove > .document-status,
  .document-row.pcs-has-remove > button {
    grid-column: 2;
    justify-self: start;
  }

  .pcs-staffing-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .pcs-staffing-metric {
    border-bottom: 1px solid var(--line);
  }

  .pcs-staffing-actions,
  .pcs-staffing-message,
  .pcs-staffing-next-step,
  .pcs-reconciliation-actions,
  .pcs-reconciliation-message {
    align-items: stretch;
    flex-direction: column;
  }

  .pcs-staffing-actions button,
  .pcs-staffing-message button,
  .pcs-staffing-next-step button,
  .pcs-reconciliation-actions button,
  .pcs-reconciliation-message button {
    width: 100%;
    margin-left: 0;
  }

  .pcs-reconciliation-metrics {
    grid-template-columns: 1fr 1fr;
  }
}
