/* Standard Table (modern) */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
}

/* Scrollable Table (infinite scroll) */
.table-scroll-container {
  width: 100%;
  max-height: var(--table-height, calc(100vh - 220px));
  overflow-y: auto;
  overflow-x: auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
}

.table-scroll-container .std-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.table-loading-row {
  text-align: center;
  padding: 16px;
  color: #888;
  font-size: 13px;
}

.std-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.std-table thead {
  background-color: white;
}

.std-table thead th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: #4a4a4a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* box-shadow instead of border so it stays fixed while the header is sticky */
  box-shadow: inset 0 -2px 0 var(--color1);
}

.std-table tbody tr {
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s;
  cursor: pointer;
}

.std-table tbody tr:last-child {
  border-bottom: none;
}

.std-table tbody tr:nth-child(even) {
  background-color: #e9eef2;
}

.std-table tbody tr:hover {
  background-color: var(--color2);
}

.std-table tbody td {
  padding: 8px 12px;
  color: #333;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sortable Headers */
.th-sortable {
  cursor: pointer;
  user-select: none;
}

.th-sortable:hover {
  color: #222;
}

.th-sortable .sort-icon {
  margin-left: 6px;
  font-size: 10px;
  color: var(--color1);
}

/* Table Actions */
.table-actions {
  display: flex;
  align-items: center;
  column-gap: 6px;
}

/* Results table - horizontal scroll with fixed column widths */
.results-table {
  min-width: 1425px;
  table-layout: fixed;
}

/* Attendance columns (compact, centered, with vertical separators) */
.std-table thead th.th-att {
  text-align: center;
  padding: 12px 4px;
  font-size: 11px;
  border-left: 1px solid #e0e0e0;
}

.std-table tbody td.td-att {
  text-align: center;
  padding: 10px 4px;
  border-left: 1px solid #e8e8e8;
}

.std-table tbody td.td-att input[type="checkbox"] {
  cursor: pointer;
  margin: 0;
}

/* centered column without the vertical separator (e.g. a single attendance checkbox) */
.std-table thead th.th-center,
.std-table tbody td.td-center {
  text-align: center;
}

.std-table tbody td.td-center input[type="checkbox"] {
  cursor: pointer;
  margin: 0;
}

/* Row actions (vertical dots) */
.std-table thead th.th-actions {
  border-left: 1px solid #e0e0e0;
}

/* variant without the left separator (tables that don't have the attendance grid) */
.std-table thead th.th-actions.th-actions-plain {
  border-left: none;
}

.std-table tbody td.td-actions {
  text-align: center;
  padding: 8px 2px;
  border-left: 1px solid #e8e8e8;
}

/* variant without the left separator (tables that don't have the attendance grid) */
.std-table tbody td.td-actions.td-actions-plain {
  border-left: none;
}

.row-actions-btn {
  border: none;
  background: none;
  cursor: pointer;
  color: #888;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 5px;
  transition: background-color 0.15s, color 0.15s;
}

.row-actions-btn:hover {
  background-color: rgba(0, 0, 0, 0.06);
  color: var(--color1);
}

.row-actions-btn:focus {
  outline: none;
}

/* Row actions dropdown menu */
.row-actions-menu {
  position: fixed;
  display: none;
  flex-direction: column;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 1200;
  min-width: 150px;
}

.row-actions-menu.open {
  display: flex;
}

.row-actions-menu-row {
  display: flex;
  column-gap: 4px;
}

.row-actions-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  column-gap: 8px;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: #333;
  border-radius: 6px;
  transition: background-color 0.15s, color 0.15s;
}

.row-actions-item:hover {
  background-color: var(--color3);
  color: var(--color1);
}

.row-actions-item:focus {
  outline: none;
}

.row-actions-item.item-delete:hover {
  background-color: #ffe6e6;
  color: var(--errorColor);
}

/* disabled action item (e.g. delete when the student has payments/attendance) */
.row-actions-item.row-actions-item-disabled {
  color: #bbb;
  cursor: not-allowed;
}

.row-actions-item.row-actions-item-disabled:hover {
  background-color: transparent;
  color: #bbb;
}

.row-actions-item i {
  font-size: 12px;
}

/* ID cell with async credential/mail error alert */
.std-table tbody td.td-id-async {
  white-space: nowrap;
}

.async-error-alert {
  margin-left: 6px;
  color: var(--errorColor);
  font-size: 12px;
  cursor: help;
}

/* Paid cell (checkbox + payment alert) */
.std-table tbody td.td-paid {
  overflow: visible;
  position: relative;
}

/* the checkbox stays centered in the cell regardless of the alert */
.paid-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* the alert floats to the right without pushing the checkbox out of center */
.payment-alert {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 3px;
  border-radius: 4px;
  transition: transform 0.1s;
}

.payment-alert:hover { transform: translateY(-50%) scale(1.15); }

.payment-alert.alert-under { color: var(--errorColor); }
.payment-alert.alert-over  { color: var(--okColor); }

/* detail inside the payment popup */
.pt-detail {
  opacity: 0.7;
}

/* Floating tooltip (positioned with JS, never clipped) */
.floating-tooltip {
  position: fixed;
  display: none;
  background-color: #2b2b2b;
  color: white;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  z-index: 2500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.floating-tooltip.show {
  display: block;
  opacity: 1;
}
