/* Table Container */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg-secondary);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead {
  background-color: var(--bg-tertiary);
  border-bottom: 2px solid var(--border);
}

.table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
  position: relative;
}

.table th.sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 2rem;
}

.table th.sortable:hover {
  background-color: var(--bg-hover);
}

.table th.sortable::after {
  content: '';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 5v14M5 12l7 7 7-7'/%3E%3C/svg%3E");
  background-size: contain;
}

.table th.sort-asc::after {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E");
}

.table th.sort-desc::after {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M12 5v14M5 12l7 7 7-7'/%3E%3C/svg%3E");
}

.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
}

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

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

.table td {
  padding: 0.75rem 1rem;
  color: var(--text-primary);
}

.table td.text-right {
  text-align: right;
}

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

/* Table Actions */
.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Empty State */
.table-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

/* Responsive Table */
@media (max-width: 768px) {
  .table {
    font-size: 0.75rem;
  }

  .table th,
  .table td {
    padding: 0.5rem 0.75rem;
  }
}
