/*
 * COUNSIVA v3.7.11 — six operational list column alignment.
 * Supplemental to operational-list-density-v379.css.
 */

#studentList .table-wrap,
#leadList .table-wrap,
#visitorList .table-wrap,
#followupList .table-wrap,
#counsellingList .table-wrap,
#view-applications .table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
}

.operational-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.operational-data-table th,
#view-applications .data-table th {
  padding: 6px 7px;
  font-size: 9.75px;
  line-height: 1.12;
  vertical-align: middle;
  white-space: nowrap;
}

.operational-data-table td,
#view-applications #appBody td {
  padding: 6px 7px;
  font-size: 11px;
  line-height: 1.18;
  vertical-align: middle;
}

.operational-data-table tbody tr {
  height: 72px;
}

.visitors-data-table tbody tr,
#view-applications #appBody tr {
  height: 76px;
}

.operational-data-table .op-primary {
  display: block;
  font-size: 12px;
  line-height: 1.16;
}

.operational-data-table .op-subline,
#view-applications .op-subline {
  display: block;
  margin-top: 2px;
  color: #6b778c;
  font-size: 9.5px;
  line-height: 1.15;
}

.operational-data-table .op-secondary,
#view-applications .op-secondary {
  color: #64748b;
  font-size: 9.5px;
  line-height: 1.2;
}

.op-clamp-1,
.op-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
}

.op-clamp-1 {
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.op-clamp-2 {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.operational-data-table .op-wrap,
#view-applications .op-wrap {
  max-width: 240px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.operational-data-table .health-line {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.operational-data-table .badge,
#view-applications #appBody .badge {
  padding: 2px 5px;
  font-size: 9px;
  line-height: 1.05;
}

.operational-data-table .row-number,
#view-applications #appBody .row-number {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

/* Students */
.student-data-table { min-width: 1090px; }
.student-data-table th:nth-child(2), .student-data-table td:nth-child(2) { min-width: 210px; }
.student-data-table th:nth-child(3), .student-data-table td:nth-child(3) { min-width: 110px; white-space: nowrap; }
.student-data-table th:nth-child(4), .student-data-table td:nth-child(4) { min-width: 72px; }
.student-data-table th:nth-child(5), .student-data-table td:nth-child(5) { min-width: 145px; }
.student-data-table th:nth-child(6), .student-data-table td:nth-child(6) { min-width: 100px; }
.student-data-table th:nth-child(7), .student-data-table td:nth-child(7) { min-width: 150px; }
.student-data-table th:last-child, .student-data-table td:last-child { min-width: 145px; width: 145px; }

#studentList .student-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(60px, 1fr));
  gap: 3px;
  min-width: 132px;
}

#studentList .student-actions .btn,
#studentList .student-actions .cai-context-action {
  width: 100%;
  min-height: 26px;
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.05;
  margin: 0 !important;
  white-space: nowrap;
}

/* Leads */
.leads-data-table { min-width: 1220px; }
.leads-data-table th:nth-child(2), .leads-data-table td:nth-child(2) { min-width: 200px; }
.leads-data-table th:nth-child(3), .leads-data-table td:nth-child(3) { min-width: 110px; white-space: nowrap; }
.leads-data-table th:nth-child(4), .leads-data-table td:nth-child(4) { min-width: 115px; }
.leads-data-table th:nth-child(5), .leads-data-table td:nth-child(5) { min-width: 180px; }
.leads-data-table th:nth-child(6), .leads-data-table td:nth-child(6) { min-width: 200px; }
.leads-data-table th:nth-child(7), .leads-data-table td:nth-child(7) { min-width: 140px; }

/* Visitors */
.visitors-data-table { min-width: 1450px; }
.visitors-data-table th:nth-child(2), .visitors-data-table td:nth-child(2) { min-width: 200px; }
.visitors-data-table th:nth-child(3), .visitors-data-table td:nth-child(3) { min-width: 180px; }
.visitors-data-table th:nth-child(4), .visitors-data-table td:nth-child(4) { min-width: 115px; }
.visitors-data-table th:nth-child(5), .visitors-data-table td:nth-child(5) { min-width: 205px; }
.visitors-data-table th:nth-child(6), .visitors-data-table td:nth-child(6) { min-width: 175px; }
.visitors-data-table th:nth-child(7), .visitors-data-table td:nth-child(7) { min-width: 195px; }
.visitors-data-table th:nth-child(8), .visitors-data-table td:nth-child(8) { min-width: 125px; }

/* Follow-ups — Notes is intentionally compact/secondary. */
.followups-data-table { min-width: 1570px; }
.followups-data-table th:nth-child(2), .followups-data-table td:nth-child(2) { min-width: 195px; }
.followups-data-table th:nth-child(3), .followups-data-table td:nth-child(3) { min-width: 145px; }
.followups-data-table th:nth-child(4), .followups-data-table td:nth-child(4) { min-width: 115px; }
.followups-data-table th:nth-child(5), .followups-data-table td:nth-child(5) { min-width: 220px; }
.followups-data-table th:nth-child(6), .followups-data-table td:nth-child(6) { min-width: 175px; }
.followups-data-table th:nth-child(7), .followups-data-table td:nth-child(7) { min-width: 110px; }
.followups-data-table th:nth-child(8), .followups-data-table td:nth-child(8) { min-width: 185px; max-width: 210px; }
.followups-data-table th:nth-child(9), .followups-data-table td:nth-child(9) { min-width: 120px; }

/* Counselling — Notes is intentionally compact/secondary. */
.counselling-data-table { min-width: 1510px; }
.counselling-data-table th:nth-child(2), .counselling-data-table td:nth-child(2) { min-width: 195px; }
.counselling-data-table th:nth-child(3), .counselling-data-table td:nth-child(3) { min-width: 115px; }
.counselling-data-table th:nth-child(4), .counselling-data-table td:nth-child(4) { min-width: 150px; }
.counselling-data-table th:nth-child(5), .counselling-data-table td:nth-child(5) { min-width: 165px; }
.counselling-data-table th:nth-child(6), .counselling-data-table td:nth-child(6) { min-width: 195px; }
.counselling-data-table th:nth-child(7), .counselling-data-table td:nth-child(7) { min-width: 195px; }
.counselling-data-table th:nth-child(8), .counselling-data-table td:nth-child(8) { min-width: 185px; max-width: 210px; }
.counselling-data-table th:nth-child(9), .counselling-data-table td:nth-child(9) { min-width: 120px; }

/* Shared actions */
.workflow-table-actions,
#leadList .lead-table-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 3px;
  min-width: 205px;
  align-items: center;
}

.workflow-table-actions .btn,
#leadList .lead-table-actions .btn {
  width: 100%;
  min-height: 26px;
  padding: 4px 5px;
  font-size: 9.75px;
  line-height: 1.05;
  margin: 0;
  white-space: nowrap;
}

.operational-data-table th:last-child,
.operational-data-table td:last-child {
  min-width: 220px;
  width: 220px;
}

/* Applications */
#view-applications .data-table {
  min-width: 1730px !important;
  border-collapse: separate;
  border-spacing: 0;
}

#view-applications .app-select-col,
#view-applications #appBody td:nth-child(2) {
  min-width: 40px;
  width: 40px;
  max-width: 40px;
  text-align: center;
}

#view-applications .data-table th:nth-child(3),
#view-applications .data-table td:nth-child(3) { min-width: 100px; }
#view-applications .data-table th:nth-child(4),
#view-applications .data-table td:nth-child(4) { min-width: 70px; }
#view-applications .data-table th:nth-child(5),
#view-applications .data-table td:nth-child(5) { min-width: 175px; }
#view-applications .data-table th:nth-child(6),
#view-applications .data-table td:nth-child(6) { min-width: 145px; }
#view-applications .data-table th:nth-child(7),
#view-applications .data-table td:nth-child(7) { min-width: 165px; }
#view-applications .data-table th:nth-child(8),
#view-applications .data-table td:nth-child(8) { min-width: 205px; }
#view-applications .data-table th:nth-child(9),
#view-applications .data-table td:nth-child(9) { min-width: 90px; }
#view-applications .data-table th:nth-child(10),
#view-applications .data-table td:nth-child(10) { min-width: 115px; }
#view-applications .data-table th:nth-child(11),
#view-applications .data-table td:nth-child(11) { min-width: 90px; }
#view-applications .data-table th:nth-child(12),
#view-applications .data-table td:nth-child(12) { min-width: 155px; }
#view-applications .data-table th:nth-child(13),
#view-applications .data-table td:nth-child(13) { min-width: 100px; white-space: nowrap; }

#view-applications .data-table th:last-child,
#view-applications .data-table td:last-child {
  min-width: 290px !important;
  width: 290px !important;
}

#view-applications .application-actions,
#view-applications #appBody .actions {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(60px, 1fr)) !important;
  gap: 3px !important;
  min-width: 270px !important;
  align-items: center;
}

#view-applications .application-actions .btn,
#view-applications #appBody .actions .btn,
#view-applications #appBody td:last-child > .btn {
  min-height: 26px !important;
  padding: 4px 5px !important;
  font-size: 9.75px !important;
  line-height: 1.05 !important;
  margin: 0 !important;
  white-space: nowrap;
}

#view-applications .application-actions .return-processing,
#view-applications #appBody .actions .return-processing {
  grid-column: 1 / -1;
}

@media (min-width: 1100px) {
  .operational-data-table th:last-child,
  .operational-data-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 5;
    background: #fff;
    box-shadow: -1px 0 0 var(--line);
  }
  .operational-data-table th:last-child {
    z-index: 8;
    background: #f6fafc;
  }
  .operational-data-table tbody tr:hover td:last-child {
    background: #f9fcfd;
  }
}

@media (max-width: 760px) {
  .operational-data-table th,
  .operational-data-table td,
  #view-applications .data-table th,
  #view-applications #appBody td {
    padding: 6px;
  }
  .operational-data-table tbody tr,
  .visitors-data-table tbody tr,
  #view-applications #appBody tr {
    height: auto;
  }
}
