.ch-users-table-root {
  background: var(--ch-bg-card);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-lg);
  overflow: hidden;
}

:where(.ch-users-table-root) .ch-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}

:where(.ch-users-table-root) .ch-table thead {
  background: var(--ch-bg-secondary);
}

:where(.ch-users-table-root) .ch-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--ch-text-primary);
  border-bottom: 2px solid var(--ch-border);
}

:where(.ch-users-table-root) .ch-table td {
  padding: 14px 16px;
  color: var(--ch-text-primary);
  border-bottom: 1px solid var(--ch-border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:where(.ch-users-table-root) .ch-table tbody tr:hover {
  background: var(--ch-bg-secondary);
}

:where(.ch-users-table-root) .ch-table tbody tr:last-child td {
  border-bottom: none;
}

:where(.ch-users-table-root) .ch-table col.ch-users-name-col {
  width: 16%;
}

:where(.ch-users-table-root) .ch-table col.ch-users-email-col {
  width: 32%;
}

:where(.ch-users-table-root) .ch-table col.ch-users-home-col {
  width: 14%;
}

:where(.ch-users-table-root) .ch-table col.ch-users-role-col {
  width: 10%;
}

:where(.ch-users-table-root) .ch-table col.ch-users-action-col {
  width: 280px;
}

:where(.ch-users-table-root) .ch-action-cell {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

:where(.ch-users-table-root) .ch-action-inner {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow: hidden;
}

:where(.ch-users-table-root) .ch-action-content {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  box-sizing: border-box;
  font-family: var(--ch-font-primary);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

:where(.ch-users-table-root) .ch-delete-btn {
  padding: 8px 16px;
  background: var(--ch-danger-bg);
  color: var(--ch-danger);
  border: 1px solid var(--ch-danger-border);
  border-radius: var(--ch-radius-md);
  cursor: pointer;
  transition: opacity var(--ch-transition-fast), transform var(--ch-transition-fast), background-color var(--ch-transition-fast), color var(--ch-transition-fast), border-color var(--ch-transition-fast), box-shadow var(--ch-transition-fast);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font: inherit;
  line-height: 1.2;
}

:where(.ch-users-table-root) .ch-delete-btn:hover {
  background: var(--ch-danger);
  color: var(--ch-text-inverse);
}

:where(.ch-users-table-root) .ch-edit-btn {
  padding: 8px 16px;
  background: var(--ch-bg-secondary);
  color: var(--ch-text-primary);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-md);
  cursor: pointer;
  transition: opacity var(--ch-transition-fast), transform var(--ch-transition-fast), background-color var(--ch-transition-fast), color var(--ch-transition-fast), border-color var(--ch-transition-fast), box-shadow var(--ch-transition-fast);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font: inherit;
  line-height: 1.2;
}

:where(.ch-users-table-root) .ch-edit-btn:hover {
  background: var(--ch-border);
}

:where(.ch-users-table-root) .ch-name-cell-empty {
  color: var(--ch-text-muted);
  font-style: italic;
}

:where(.ch-users-table-root) .ch-confirm-group {
  display: inline-flex;
  width: 100%;
  align-items: center;
}

:where(.ch-users-table-root) .ch-confirm-label {
  color: var(--ch-danger);
  flex: 1 1 auto;
  min-width: 0;
}

:where(.ch-users-table-root) .ch-confirm-yes,
:where(.ch-users-table-root) .ch-confirm-no {
  padding: 6px 12px;
  border-radius: var(--ch-radius-sm);
  cursor: pointer;
  transition: opacity var(--ch-transition-fast), transform var(--ch-transition-fast), background-color var(--ch-transition-fast), color var(--ch-transition-fast), border-color var(--ch-transition-fast), box-shadow var(--ch-transition-fast);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font: inherit;
  line-height: 1.2;
  flex: 0 0 auto;
}

:where(.ch-users-table-root) .ch-confirm-yes {
  background: var(--ch-danger);
  color: var(--ch-text-inverse);
  border: none;
}

:where(.ch-users-table-root) .ch-confirm-yes:hover {
  background: var(--ch-danger-hover);
}

:where(.ch-users-table-root) .ch-confirm-no {
  background: var(--ch-bg-secondary);
  color: var(--ch-text-primary);
  border: 1px solid var(--ch-border);
}

:where(.ch-users-table-root) .ch-confirm-no:hover {
  background: var(--ch-bg-elevated);
}

:where(.ch-users-table-root) .ch-empty-state {
  padding: 48px;
  text-align: center;
  color: var(--ch-text-muted);
}

:where(.ch-users-table-root) .ch-empty-state-icon {
  display: inline-block;
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
  line-height: 0;
}

:where(.ch-users-table-root) .ch-empty-state-text {
  font-size: 14px;
}

@media (max-width: 768px) {
  .ch-users-table-root {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  :where(.ch-users-table-root) .ch-table,
  :where(.ch-users-table-root) .ch-table tbody,
  :where(.ch-users-table-root) .ch-table tr,
  :where(.ch-users-table-root) .ch-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  :where(.ch-users-table-root) .ch-table {
    border-collapse: separate;
    table-layout: auto;
  }

  :where(.ch-users-table-root) .ch-table colgroup,
  :where(.ch-users-table-root) .ch-table thead {
    display: none;
  }

  :where(.ch-users-table-root) .ch-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  :where(.ch-users-table-root) .ch-table tbody tr {
    padding: 14px;
    background: var(--ch-bg-card);
    border: 1px solid var(--ch-border);
    border-radius: var(--ch-radius-md);
    box-shadow: var(--ch-shadow-sm);
  }

  :where(.ch-users-table-root) .ch-table tbody tr:hover {
    background: var(--ch-bg-card);
  }

  :where(.ch-users-table-root) .ch-table th,
  :where(.ch-users-table-root) .ch-table td {
    padding: 0;
    border-bottom: none;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  :where(.ch-users-table-root) .ch-table td + td {
    margin-top: 10px;
  }

  :where(.ch-users-table-root) .ch-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ch-text-muted);
  }

  :where(.ch-users-table-root) .ch-action-cell::before {
    display: none;
  }

  :where(.ch-users-table-root) .ch-action-inner {
    min-height: 40px;
  }

  :where(.ch-users-table-root) .ch-action-content {
    width: 100%;
    min-height: 40px;
  }

  :where(.ch-users-table-root) .ch-delete-btn {
    width: 100%;
  }

  :where(.ch-users-table-root) .ch-confirm-group {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
  }

  :where(.ch-users-table-root) .ch-confirm-label {
    align-self: center;
  }
}
