#main .table {
  caption-side: bottom;
  font-size: var(--text-sm);
  inline-size: var(--size-full);
  border-collapse: separate;
  border-spacing: 0;

  caption {
    color: var(--color-text-subtle);
    margin-block-start: var(--size-4);
  }

  thead {
    color: var(--color-text-subtle);
    background-color: rgb(from var(--color-border-light) r g b / .5);
  }

  tbody tr {
    border-block-start-width: var(--border);
  }

  tr:hover {
    background-color: rgb(from var(--color-border-light) r g b / .5);
  }

  th {
    font-weight: var(--font-medium);
    text-align: start;
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: rgb(from var(--color-border-light) r g b / .5);
  }

  th, td {
    padding: var(--size-3) var(--size-4);
    vertical-align: middle;
  }

  tfoot {
    background-color: rgb(from var(--color-border-light) r g b / .5);
    border-block-start-width: var(--border);
    font-weight: var(--font-medium);
  }
}

/* Responsive table */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  margin-bottom: var(--size-4);
}

/* Striped table */
#main .table-striped tbody tr:nth-child(odd) {
  background-color: rgb(from var(--color-border-light) r g b / .3);
}

/* Bordered table */
.table-bordered th,
.table-bordered td {
  border-width: var(--border);
}

/* Compact table */
.table-compact th,
.table-compact td {
  padding: var(--size-1) var(--size-2);
}

/* CSS-Zero inspired table styles */
.table-container {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 1rem;
}

.cz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 0.375rem;
  overflow: hidden;
}

.cz-table-header {
  background-color: #f8f9fa;
  color: #495057;
}

.cz-table-header th {
  padding: 1rem 1.5rem;
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid #dee2e6;
}

.cz-table-body tr {
  border-bottom: 1px solid #dee2e6;
}

.cz-table-body tr:hover {
  background-color: #f8f9fa;
}

.cz-table-row {
  transition: background-color 0.2s ease;
}

.cz-table-cell {
  padding: 1rem 1.5rem;
  vertical-align: middle;
}

.cz-table-description {
  color: #6c757d;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.cz-badge {
  display: inline-block;
  padding: 0.25em 0.4em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  background-color: #6f42c1;
  color: #fff;
}

.cz-button {
  display: inline-block;
  font-weight: 400;
  color: #212529;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  background-color: transparent;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
  margin-right: 0.5rem;
  text-decoration: none;
}

.cz-button-edit {
  color: #007bff;
  border-color: #007bff;
}

.cz-button-edit:hover {
  color: #fff;
  background-color: #007bff;
  border-color: #007bff;
}

.cz-button-delete {
  color: #dc3545;
  border-color: #dc3545;
}

.cz-button-delete:hover {
  color: #fff;
  background-color: #dc3545;
  border-color: #dc3545;
}

.cz-button-new {
  color: #7F00FF;
  border-color: #7F00FF;
  text-decoration: none;
}

.cz-button-new:hover {
  color: #fff;
  background-color: #7F00FF;
  border-color: #7F00FF;
  text-decoration: none;
}

/* Responsive table column hiding */
@media (max-width: 768px) {
  .cz-hide-mobile {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .cz-hide-tablet {
    display: none !important;
  }
}

/* Type/Status combined column styling */
.cz-type-status {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cz-badge-type {
  background-color: #6f42c1 !important;
  font-size: 0.7em;
}

/* Ensure Actions column is always visible and properly sized */
.cz-table th:last-child,
.cz-table td:last-child {
  min-width: 160px;
  white-space: nowrap;
}

/* Optimize table for better responsive behavior */
@media (max-width: 1200px) {
  .cz-table-cell {
    padding: 0.75rem 1rem;
  }
  
  .cz-table-header th {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 900px) {
  .cz-table-cell {
    padding: 0.5rem 0.75rem;
  }
  
  .cz-table-header th {
    padding: 0.5rem 0.75rem;
  }
  
  .cz-button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    margin-right: 0.25rem;
  }
}
