.table-wrap {
  overflow: auto;
  border: 1px solid rgba(208, 199, 201, 0.75);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

/* Evita cortar o menu ⋯ nas linhas */
.table-wrap:has([data-dropdown-menu]:not([hidden])) {
  overflow: visible;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.table th,
.table td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--ink-700);
  font-weight: 600;
  white-space: nowrap;
}

.table tbody tr:hover {
  background: var(--brand-50);
}

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

.table__sort {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

.table__sort:hover {
  color: var(--brand-700);
}

.table-empty,
.table__empty {
  padding: var(--s-6) var(--s-4);
  text-align: center;
  color: var(--ink-500);
}

.table-empty strong,
.table__empty strong {
  display: block;
  color: var(--ink-900);
  margin-bottom: var(--s-1);
}

.table-card a.table-card__title {
  font-weight: 600;
  color: var(--brand-700);
  text-decoration: none;
}

.table-card a.table-card__title:hover {
  text-decoration: underline;
}

.table-card--emergency {
  border-color: var(--danger);
  box-shadow: inset 3px 0 0 var(--danger);
}

/* Mobile cards */
.table-cards {
  display: none;
}

@media (max-width: 639px) {
  .table-wrap--responsive .table {
    display: none;
  }

  .table-cards {
    display: grid;
    gap: var(--s-3);
  }

  .table-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--s-4);
    display: grid;
    gap: var(--s-2);
  }

  .table-card__row {
    display: flex;
    justify-content: space-between;
    gap: var(--s-3);
    font-size: var(--fs-sm);
  }

  .table-card__label {
    color: var(--ink-500);
  }
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: var(--s-4);
  font-size: var(--fs-sm);
  color: var(--ink-500);
}

.pagination__pages {
  display: flex;
  gap: var(--s-1);
}

.pagination__pages a,
.pagination__pages span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-700);
  text-decoration: none;
}

.pagination__pages a:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
}

.pagination__pages .is-current {
  background: var(--brand-700);
  border-color: var(--brand-700);
  color: #fff;
}
