/* Table Component
   ========================================================================== */

.table {
  width: 100%;
  border-collapse: collapse;
  border: none;
  margin-block: 0;
  font-size: var(--font-small-medium-responsive);
}

/* Remove all default borders */
.table,
.table thead,
.table tbody,
.table tr,
.table th,
.table td {
  border-left: none;
  border-right: none;
}

/* Header */
.table th {
  padding: var(--block-space-half) var(--inline-space);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-small-responsive);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-top: none;
  border-bottom: 1.5px solid var(--color-gray-dark);
}

.table th:first-child {
  padding-inline-start: 0;
}

.table th:last-child {
  padding-inline-end: 0;
}

/* Cells */
.table td {
  padding: var(--block-space-half) var(--inline-space);
  vertical-align: middle;
  border-top: none;
  border-bottom: var(--border);
}

.table td:first-child {
  padding-inline-start: 0;
}

.table td:last-child {
  padding-inline-end: 0;
}


/* Active row (current item) */
.table tbody tr.table-active {
  background-color: var(--color-blue-light);
}

.table tbody tr.table-active:hover {
  background-color: var(--color-blue-light);
}

/* Alignment helpers */
.table .text-right,
.table th.text-right,
.table td.text-right {
  text-align: right;
}

.table .text-center,
.table th.text-center,
.table td.text-center {
  text-align: center;
}

/* Action column (last column with icons/buttons) */
.table td:last-child {
  white-space: nowrap;
}

/* Numeric columns - right align */
.table td[data-type="number"],
.table th[data-type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Remove bottom border on last row */
.table tbody tr:last-child td {
  border-bottom: none;
}

/* Fixed table layout variant */
.fixed-table {
  table-layout: fixed;
  width: 100%;
}

.fixed-table th,
.fixed-table td {
  width: 33.33%;
}

/* Shrink columns to fit content */
.table .col-shrink {
  width: 1%;
  white-space: nowrap;
}

/* Limit column width (for name columns that shouldn't expand too much) */
.table .col-20 {
  width: 20%;
}

/* Diagonal header text for compact columns */
.table .th-diagonal {
  height: 7em;
  vertical-align: bottom;
  position: relative;
}

.table .th-diagonal > span {
  position: absolute;
  bottom: 0.5em;
  left: 50%;
  transform: rotate(-45deg);
  transform-origin: bottom left;
  white-space: nowrap;
}

/* Even width for status columns (ERFÜLLT, AUSGEFÜLLT?, QUALIFIKATION) */
.table .th-status-col {
  width: 5em;
}

/* Responsive column hiding - uses container queries when available */
.overflow-x {
  container-type: inline-size;
}

/* Container-based hiding (responds to actual available space) */
@container (max-width: 1100px) {
  .table .hide-lg {
    display: none;
  }
}

@container (max-width: 900px) {
  .table .hide-md {
    display: none;
  }
}

@container (max-width: 500px) {
  .table .hide-sm {
    display: none;
  }
}

/* Fallback for tables without container (viewport-based) */
@media (max-width: 1700px) {
  .table:not(.overflow-x .table) .hide-lg {
    display: none;
  }
}

@media (max-width: 1200px) {
  .table:not(.overflow-x .table) .hide-md {
    display: none;
  }
}

@media (max-width: 640px) {
  .table:not(.overflow-x .table) .hide-sm {
    display: none;
  }
}
