/* Table Styles */

/* Base Table */
.table {
  width: var(--width-full);
  margin-bottom: var(--spacing-md);
  color: var(--color-text-secondary);
  vertical-align: top;
  border-color: var(--border-color);
  caption-side: bottom;
  border-collapse: collapse;
}

.table > :not(caption) > * > * {
  padding: var(--spacing-sm) var(--spacing-sm);
  background-color: transparent;
  border-bottom-width: 1px;
  box-shadow: inset 0 0 0 9999px transparent;
}

.table > tbody {
  vertical-align: inherit;
}

.table > thead {
  vertical-align: bottom;
}

.table > :not(:first-child) {
  border-top: 2px solid currentColor;
}

/* Table Bordered */
.table-bordered > :not(caption) > * {
  border-width: 1px 0;
}

.table-bordered > :not(caption) > * > * {
  border-width: 0 1px;
}

/* Table Borderless */
.table-borderless > :not(caption) > * > * {
  border-bottom-width: 0;
}

.table-borderless > :not(:first-child) {
  border-top-width: 0;
}

/* Table Striped */
.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Table Hover */
.table-hover > tbody > tr:hover > * {
  background-color: rgba(0, 0, 0, 0.075);
}

/* Table Active */
.table-active {
  background-color: rgba(0, 0, 0, 0.1);
}

/* Table Variants */
.table-primary {
  background-color: #cfe2ff;
  border-color: #bacbe6;
}

.table-secondary {
  background-color: #e2e3e5;
  border-color: #cbccce;
}

.table-success {
  background-color: #d1e7dd;
  border-color: #bcd0c7;
}

.table-info {
  background-color: #cff4fc;
  border-color: #badce3;
}

.table-warning {
  background-color: #fff3cd;
  border-color: #e6dbb9;
}

.table-danger {
  background-color: #f8d7da;
  border-color: #dfc2c4;
}

.table-light {
  background-color: var(--color-light);
  border-color: #dfe0e1;
}

.table-dark {
  background-color: var(--color-dark);
  border-color: #373b3e;
  color: var(--color-white);
}

/* Table Small */
.table-sm > :not(caption) > * > * {
  padding: 0.25rem 0.25rem;
}

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 575.98px) {
  .table-responsive-sm {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 767.98px) {
  .table-responsive-md {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 991.98px) {
  .table-responsive-lg {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 1199.98px) {
  .table-responsive-xl {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Table Caption */
.caption-top {
  caption-side: top;
}

/* Table Head Variants */
.table-light th,
.table-light td {
  background-color: #f8f9fa;
}

.table-dark th,
.table-dark td {
  background-color: #212529;
  color: #fff;
}

/* Vertical Alignment */
.table .align-baseline {
  vertical-align: baseline !important;
}

.table .align-top {
  vertical-align: top !important;
}

.table .align-middle {
  vertical-align: middle !important;
}

.table .align-bottom {
  vertical-align: bottom !important;
}

.table .align-text-bottom {
  vertical-align: text-bottom !important;
}

.table .align-text-top {
  vertical-align: text-top !important;
}

/* Table Utilities */
.table-fixed {
  table-layout: fixed;
}

.table-nowrap td,
.table-nowrap th {
  white-space: nowrap;
}

/* Sortable Table Headers */
.table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.5rem;
}

.table th.sortable::after {
  content: "⇅";
  position: absolute;
  right: 0.5rem;
  opacity: 0.3;
}

.table th.sortable.asc::after {
  content: "↑";
  opacity: 1;
}

.table th.sortable.desc::after {
  content: "↓";
  opacity: 1;
}

/* Table Actions Column */
.table .actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.table .actions .btn {
  margin-left: 0.25rem;
}

/* Empty Table State */
.table-empty {
  text-align: center;
  padding: var(--spacing-xxl);
  color: var(--color-text-muted);
}

.table-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}