/* ============================================================
   WORKSTATION CRIATOR — tables.css
   Tabela de dados (table.dt), paginação, tabela de prévia
   (mini-table) e estados vazios.
   ============================================================ */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  background: #fff;
  /* Sombras de scroll: aparecem só quando há conteúdo além da borda. */
  background-image:
    linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)),
    linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 70%),
    linear-gradient(90deg, rgba(15, 23, 41, .10), rgba(15, 23, 41, 0)),
    linear-gradient(90deg, rgba(15, 23, 41, 0), rgba(15, 23, 41, .10));
  background-position: 0 0, 100% 0, 0 0, 100% 0;
  background-size: 44px 100%, 44px 100%, 16px 100%, 16px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}

/* Dentro de um card sem padding, o card já arredonda e recorta. */
.card {
  overflow: hidden;
}

.card:not(.card-pad)>.table-wrap {
  border: 0;
  border-radius: 0;
}

table.dt {
  width: 100%;
  border-collapse: collapse;
}

table.dt thead th {
  text-align: left;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: .04em;
  color: #ffffff;
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  background: #21305d;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

table.dt thead th.num {
  text-align: right;
}

table.dt thead th:first-child,
table.dt tbody td:first-child {
  padding-left: 15px;
}

table.dt thead th:last-child,
table.dt tbody td:last-child {
  padding-right: 10px;
}

table.dt tbody td {
  padding: 1px 1px;
  font-size: 8pt;
  color: #31363f;
  border-bottom: 1px solid #d1d6dd;
  white-space: nowrap;
  vertical-align: middle;
}

table.dt tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.dt tbody tr {
  transition: background var(--dur-fast) var(--ease);
}

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

table.dt tbody tr:hover {
  background: var(--gray-25);
}

table.dt tbody tr.row-locked {
  background: repeating-linear-gradient(135deg, transparent, transparent 8px, rgba(154, 161, 172, 0.035) 8px, rgba(154, 161, 172, 0.035) 16px);
}

.resp-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.resp-name-1 {
  font-size: var(--text-sm);
  color: var(--gray-800);
  font-weight: 600;
  white-space: nowrap;
}

.you-tag {
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--gray-400);
  margin-left: 6px;
  letter-spacing: .04em;
}

/* Ações da linha: reveladas no hover / foco (padrão Linear); sempre visíveis no touch. */
.act-row {
  display: inline-flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}

table.dt tbody tr:hover .act-row,
table.dt tbody tr:focus-within .act-row {
  opacity: 1;
}

@media (hover:none) {
  .act-row {
    opacity: 1;
  }
}

/* Ações primárias (texto) que precisam estar sempre visíveis — ex.: painel de usuários. */
.row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.act-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.act-icon:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.act-icon.edit:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

.act-icon.danger:hover {
  background: var(--red-50);
  color: var(--red-600);
}

.act-icon:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-600);
}

.act-icon.danger:focus-visible {
  box-shadow: inset 0 0 0 2px var(--red-600);
  background: var(--red-50);
  color: var(--red-600);
}

.act-icon svg {
  width: 16px;
  height: 16px;
}

.act-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--gray-400);
}

.act-lock svg {
  width: 16px;
  height: 16px;
}

/* ---------- Paginação ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 8px;
  font-size: var(--text-sm);
  color: var(--gray-500);
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--gray-50);
}

.page-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  min-width: 25px;
  height: 25px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.page-btn:hover:not([disabled]):not(.active) {
  background: var(--gray-25);
  border-color: var(--gray-300);
}

.page-btn.active {
  background: var(--blue-600);
  /* border-color: var(--blue-600); */
  color: #fff;
}

.page-btn:focus-visible {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: var(--shadow-focus);
  position: relative;
  z-index: 1;
}

.page-btn.active:focus-visible {
  box-shadow: 0 0 0 2px var(--gray-0), 0 0 0 4px var(--blue-500);
}

.page-btn svg {
  width: 13px;
  height: 13px;
}

.page-btn[disabled] {
  opacity: .4;
  cursor: not-allowed;
}

.page-size {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

/* ---------- Estado vazio ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}

.empty-state .es-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  margin-bottom: 16px;
}

.empty-state .es-icon svg {
  width: 24px;
  height: 24px;
}

.empty-state b {
  display: block;
  font-size: var(--text-lg);
  color: var(--gray-800);
  margin-bottom: 4px;
  font-weight: 700;
}

.empty-state p {
  font-size: var(--text-sm);
  max-width: 340px;
  line-height: 1.6;
}

/* ---------- Mini-tabela de prévia ---------- */
.mini-table {
  width: 100%;
  border-collapse: collapse;
}

.mini-table th {
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-500);
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}

.mini-table td {
  font-size: var(--text-xs);
  color: var(--gray-600);
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-50);
  white-space: nowrap;
}

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

.link-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  font-size: var(--text-xs);
  color: var(--blue-600);
  font-weight: 700;
  border-top: 1px solid var(--gray-50);
  margin-top: auto;
}

.link-row svg {
  width: 13px;
  height: 13px;
}