/* ---------- CONTACT LOG LAYOUT ---------- */
#contactsTable tbody tr:nth-child(even) td:nth-child(-n+6) {
  background-color: #e5e5e5;
}
#contactsTable tbody tr:nth-child(odd) td:nth-child(-n+6) {
  background-color: #fff;
}
/* Alternate row colors ONLY for the first (frozen) column, do not affect header or other columns */
#contactsTable tbody tr:nth-child(even) td:nth-child(1) {
  background-color: #e5e5e5;
}
#contactsTable tbody tr:nth-child(odd) td:nth-child(1) {
  background-color: #fff;
}

.contactlog-layout {
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem;
  gap: 12px;
}

.contactlog-tab {
  flex: 1;
  text-align: center;
  padding: 0.75rem 1rem;
  background-color: #f5f5f5;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.contactlog-tab.active {
  background-color: #861557;
  color: #fff;
}

.contactlog-tab:hover {
  background-color: #d4d4d4;
}

.contactlog-tab.active:hover {
  background-color: #861557;
}

.contactlog-content {
  padding: 0.5rem;
}

.contactlog-tab-panel {
  display: none;
}

.contactlog-tab-panel.active {
  display: block;
}

.contactlog-tab-content {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: auto auto 1fr;
  column-gap: 1.25rem;
  row-gap: 4px;
  align-items: start;
}

.contactlog-tab-content.hidden {
  display: none;
}

.add-or-edit-contact-instance {
  grid-column: 1 / 3;
  grid-row: 1 / 4;
  padding: 8px 16px !important;
}

.investigator-search {
  grid-column: 3 / 13;
  grid-row: 1;
}

.investigator-details {
  grid-column: 3 / 13;
  grid-row: 2;
  margin-top: 4px !important;
}

.site-contact-log-entries {
  grid-column: 3 / 13;
  grid-row: 3;
  min-height: 100%;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 25rem;
}

.form-field label {
  font-size: 0.9rem;
  color: #444;
  font-weight: 500;
}

.contact-comment {
  min-height: 5.5rem;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.contactlogsiteforfeasibility-liaison-notes {
  resize: vertical;
  height: 100%;
}

/* Tab 2: Sites for Feasibility Approach - 3 column layout */
#feasibility-approach-tab {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr;
  column-gap: 1rem;
  row-gap: 1rem;
  align-items: stretch;
}

#feasibility-approach-tab.hidden {
  display: none;
}

/* Sites for Feasibility Approach Tab Sections */
.contactlogsiteforfeasibility-assign-liaison-section,
.contactlogsiteforfeasibility-paper-cda-status-section,
.contactlogsiteforfeasibility-update-site-status-section {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  background-color: #fff;
}

.contactlogsiteforfeasibility-liaison-form,
.contactlogsiteforfeasibility-cda-form,
.contactlogsiteforfeasibility-site-status-form {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contactlogsiteforfeasibility-reset-link {
  color: #871553;
  text-decoration: underline;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;  
}

.contactlogsiteforfeasibility-reset-link:hover {
  color: #6b1142;
  text-decoration: underline;
}

.form-row-horizontal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 10px;
}

/* Remove gap between Paper CDA Status rows */
.contactlogsiteforfeasibility-cda-form .form-row-horizontal:nth-child(2) {
  padding-top: 0;
  margin-top: 0;
}

/* Make the form-field with textarea grow to fill space */
.contactlogsiteforfeasibility-site-status-form .form-row-horizontal .form-field:has(textarea) {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.contactlogsiteforfeasibility-site-status-form .form-row-horizontal .form-field:has(textarea) textarea {
  height: 60px;
}

/* Sticky header row */
#contactsTable thead tr th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #861557;
}

/* First column (checkbox) - sticky */
#contactsTable thead tr th:nth-child(1),
#contactsTable tbody tr td:nth-child(1) {
  position: sticky;
  left: 0;
  background-color: #fff;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  min-width: 50px;
  max-width: 50px;
  width: 50px;
}

#contactsTable thead tr th:nth-child(1) {
  z-index: 20;
  background-color: #861557;
}

#contactsTable tbody tr td:nth-child(1) {
  z-index: 5;
}

/* Second column (Survey Name) - sticky */
#contactsTable thead tr th:nth-child(2),
#contactsTable tbody tr td:nth-child(2) {
  position: sticky;
  left: 50px;
  background-color: #fff;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  max-width: 180px;
  width: 180px;
}

#contactsTable thead tr th:nth-child(2) {
  z-index: 20;
  background-color: #861557;
}

#contactsTable tbody tr td:nth-child(2) {
  z-index: 5;
}

/* Third column (Country) - sticky */
#contactsTable thead tr th:nth-child(3),
#contactsTable tbody tr td:nth-child(3) {
  position: sticky;
  left: 230px;
  background-color: #fff;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  max-width: 180px;
  width: 180px;
}

#contactsTable thead tr th:nth-child(3) {
  z-index: 20;
  background-color: #861557;
}

#contactsTable tbody tr td:nth-child(3) {
  z-index: 5;
}

/* Fourth column (First Name) - sticky */
#contactsTable thead tr th:nth-child(4),
#contactsTable tbody tr td:nth-child(4) {
  position: sticky;
  left: 410px;
  background-color: #fff;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  max-width: 150px;
  width: 150px;
}

#contactsTable thead tr th:nth-child(4) {
  z-index: 20;
  background-color: #861557;
}

#contactsTable tbody tr td:nth-child(4) {
  z-index: 5;
}

/* Fifth column (Last Name) - sticky */
#contactsTable thead tr th:nth-child(5),
#contactsTable tbody tr td:nth-child(5) {
  position: sticky;
  left: 560px;
  background-color: #fff;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  min-width: 150px;
  max-width: 150px;
  width: 150px;
}

#contactsTable thead tr th:nth-child(5) {
  z-index: 20;
  background-color: #861557;
}

#contactsTable tbody tr td:nth-child(5) {
  z-index: 5;
}

/* Sixth column (Center Name) - sticky */
#contactsTable thead tr th:nth-child(6),
#contactsTable tbody tr td:nth-child(6) {
  position: sticky;
  left: 710px;
  background-color: #fff;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  max-width: 200px;
  width: 200px;
}

#contactsTable thead tr th:nth-child(6) {
  z-index: 20;
  background-color: #861557;
}

#contactsTable tbody tr td:nth-child(6) {
  z-index: 5;
}

.investigator-details input[type="text"] {
  all: unset;
  width: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
  line-height: 100%;
  letter-spacing: -0.04em;
  color: inherit;
}

.investigator-details .label {
  font-weight: 600;
  color: #000;
  font-size: 12px;
}

.assign-liaison-description {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
  margin-bottom: 0;
}

/* ---------- SITE CONTACT LOG ENTRIES TABLE ---------- */
.sites-log-table-scroll {
  overflow-x: auto;
  width: 100%;
}

#siteContactLogEntriesTable {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Sticky header */
#siteContactLogEntriesTable thead tr th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #861557;
}

/* Column 1 - Checkbox (sticky) */
#siteContactLogEntriesTable thead tr th:nth-child(1),
#siteContactLogEntriesTable tbody tr td:nth-child(1) {
  position: sticky;
  left: 0;
  min-width: 50px;
  max-width: 50px;
  width: 50px;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  z-index: 5;
}
#siteContactLogEntriesTable thead tr th:nth-child(1) {
  z-index: 24;
  background-color: #861557;
}

/* Column 2 - Contact ID (sticky) */
#siteContactLogEntriesTable thead tr th:nth-child(2),
#siteContactLogEntriesTable tbody tr td:nth-child(2) {
  position: sticky;
  left: 50px;
  min-width: 180px;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  z-index: 5;
}
#siteContactLogEntriesTable thead tr th:nth-child(2) {
  z-index: 23;
  background-color: #861557;
}

/* Column 3 - Contact Instance ID (sticky) */
#siteContactLogEntriesTable thead tr th:nth-child(3),
#siteContactLogEntriesTable tbody tr td:nth-child(3) {
  position: sticky;
  left: 230px;
  min-width: 160px;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  z-index: 5;
}
#siteContactLogEntriesTable thead tr th:nth-child(3) {
  z-index: 22;
  background-color: #861557;
}

/* Column 4 - Contact Instance Date (sticky) */
#siteContactLogEntriesTable thead tr th:nth-child(4),
#siteContactLogEntriesTable tbody tr td:nth-child(4) {
  position: sticky;
  left: 390px;
  min-width: 170px;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  z-index: 5;
}
#siteContactLogEntriesTable thead tr th:nth-child(4) {
  z-index: 21;
  background-color: #861557;
}

/* Column 5 - Updated by (sticky) */
#siteContactLogEntriesTable thead tr th:nth-child(5),
#siteContactLogEntriesTable tbody tr td:nth-child(5) {
  position: sticky;
  left: 560px;
  min-width: 170px;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  z-index: 5;
}
#siteContactLogEntriesTable thead tr th:nth-child(5) {
  z-index: 20;
  background-color: #861557;
}

/* Freeze first 5 columns - header */
/* Sticky header row for all columns */
.site-contact-log-entries-table thead tr th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #861557;
}

/* First column (checkbox) - sticky */
.site-contact-log-entries-table thead tr th:nth-child(1),
.site-contact-log-entries-table tbody tr td:nth-child(1) {
  position: sticky;
  left: 0;
  background-color: #fff;
  box-shadow: 2px 0 2px -1px rgba(0, 0, 0, 0.1);
  min-width: 50px;
  max-width: 50px;
  width: 50px;
}

.site-contact-log-entries-table thead tr th:nth-child(1) {
  z-index: 20;
  background-color: #861557;
}

.site-contact-log-entries-table tbody tr td:nth-child(1) {
  z-index: 5;
}

.site-contact-log-entries-table tbody tr:nth-child(even) td:nth-child(1) {
  background-color: #E6E6E6;
}

.site-contact-log-entries-table tbody tr:nth-child(odd) td:nth-child(1) {
  background-color: #FFFFFF;
}

.site-contact-log-entries-table tbody tr.selected td:nth-child(1) {
  background-color: #f1dce7 !important
}


.site-contact-log-entries-table thead tr th:nth-child(2) {
  z-index: 20;
  background-color: #861557;
}

.site-contact-log-entries-table tbody tr td:nth-child(2) {
  z-index: 5;
}

.site-contact-log-entries-table tbody tr:nth-child(even) td:nth-child(2) {
  background-color: #E6E6E6;
}

.site-contact-log-entries-table tbody tr:nth-child(odd) td:nth-child(2) {
  background-color: #FFFFFF;
}

.site-contact-log-entries-table tbody tr.selected td:nth-child(2) {
  background-color: #f1dce7 !important
}

.site-contact-log-entries-table thead tr th:nth-child(3) {
  z-index: 20;
  background-color: #861557;
}

.site-contact-log-entries-table tbody tr td:nth-child(3) {
  z-index: 5;
}

.site-contact-log-entries-table tbody tr:nth-child(even) td:nth-child(3) {
  background-color: #E6E6E6;
}

.site-contact-log-entries-table tbody tr:nth-child(odd) td:nth-child(3) {
  background-color: #FFFFFF;
}

.site-contact-log-entries-table tbody tr.selected td:nth-child(3) {
  background-color: #f1dce7 !important
}

.site-contact-log-entries-table thead tr th:nth-child(4) {
  z-index: 20;
  background-color: #861557;
}

.site-contact-log-entries-table tbody tr td:nth-child(4) {
  z-index: 5;
}

.site-contact-log-entries-table tbody tr:nth-child(even) td:nth-child(4) {
  background-color: #E6E6E6;
}

.site-contact-log-entries-table tbody tr:nth-child(odd) td:nth-child(4) {
  background-color: #FFFFFF;
}

.site-contact-log-entries-table tbody tr.selected td:nth-child(4) {
  background-color: #f1dce7 !important;
}

.site-contact-log-entries-table thead tr th:nth-child(5) {
  z-index: 20;
  background-color: #861557;
}

.site-contact-log-entries-table tbody tr td:nth-child(5) {
  z-index: 5;
}

.site-contact-log-entries-table tbody tr:nth-child(even) td:nth-child(5) {
  background-color: #E6E6E6;
}

.site-contact-log-entries-table tbody tr:nth-child(odd) td:nth-child(5) {
  background-color: #FFFFFF;
}

.site-contact-log-entries-table tbody tr.selected td:nth-child(5) {
  background-color: #f1dce7 !important;
}

.site-contact-log-entries-table thead tr th:nth-child(6) {
  z-index: 20;
  background-color: #861557;
}

.site-contact-log-entries-table tbody tr td:nth-child(6) {
  z-index: 5;
}

.site-contact-log-entries-table tbody tr:nth-child(even) td:nth-child(6) {
  background-color: #E6E6E6;
}

.site-contact-log-entries-table tbody tr:nth-child(odd) td:nth-child(6) {
  background-color: #FFFFFF;
}

.site-contact-log-entries-table tbody tr.selected td:nth-child(6) {
  background-color: #f1dce7 !important
}

/* Sites table base */
.site-contact-log-entries-table {
  width: 100%;
  border-collapse: collapse;
  background: #FFFFFF;
  font-size: 14.4px !important;
  min-width: 1200px;
  overflow: visible;
}

/* Sites table header */
.site-contact-log-entries-table thead {
  background-color: #861557;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-contact-log-entries-table thead th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #FFFFFF;  
  border-right: none;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.04em;
  background-color: #861557;
}

.site-contact-log-entries-table thead th:last-child {
  border-right: none;
}

.site-contact-log-entries-table thead th:first-child {
  width: 35px;
  text-align: center;
  padding: 0.625rem 0.5rem;
}

/* Sites table body */
.site-contact-log-entries-table tbody tr {
  border-bottom: 1px solid #e8e8e8;
  background-color: #FFFFFF;
}

.site-contact-log-entries-table tbody tr:nth-child(even) {
  background-color: #E6E6E6;
}

.site-contact-log-entries-table tbody tr.selected {
  background-color: #f1dce7 !important;
}

.site-contact-log-entries-table tbody td {
  padding: 0.625rem 0.75rem;
  color: #333;
  vertical-align: middle;
  border-right: none;
  font-family: inherit;
  font-size: 16px !important;
}

.site-contact-log-entries-table tbody td:last-child {
  border-right: none;
}

.site-contact-log-entries-table tbody td:first-child {
  text-align: center;
  padding: 0.625rem 0.5rem;
}

/* Sites table checkbox */
.site-contact-log-entries-table input[type="checkbox"] {
  cursor: pointer;
  width: 15px;
  height: 15px;
  margin: 0;
}